Skip to content

Commit c7194b9

Browse files
committed
test(realtime): type the room fixture instead of casting it
1 parent 1e2240c commit c7194b9

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

‎apps/sim/app/workspace/[workspaceId]/hooks/use-workspace-invalidation-room.test.tsx‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
/**
22
* @vitest-environment jsdom
33
*/
4+
45
import { act } from 'react'
6+
import type { RoomType } from '@sim/realtime-protocol/rooms'
57
import { createRoot, type Root } from 'react-dom/client'
68
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
79

@@ -20,10 +22,9 @@ function fakeSocket() {
2022
let socket: ReturnType<typeof fakeSocket>
2123
const roots: Root[] = []
2224

23-
function mount(workspaceId: string, roomType: string): Root {
25+
function mount(workspaceId: string, roomType: RoomType): Root {
2426
function Probe() {
25-
// biome-ignore lint/suspicious/noExplicitAny: the room type union is not exported for tests
26-
useWorkspaceInvalidationRoom(workspaceId, roomType as any, () => {})
27+
useWorkspaceInvalidationRoom(workspaceId, roomType, () => {})
2728
return null
2829
}
2930
const container = document.createElement('div')

0 commit comments

Comments
 (0)