diff --git a/src/state/CallViewModel.test.ts b/src/state/CallViewModel.test.ts index 804157db..522951e5 100644 --- a/src/state/CallViewModel.test.ts +++ b/src/state/CallViewModel.test.ts @@ -34,7 +34,7 @@ import { mockRoomMember, mockRemoteParticipant, withTestScheduler, - mockMembership, + mockRtcMembership, MockRTCSession, } from "../utils/test"; import { @@ -45,10 +45,10 @@ import { E2eeType } from "../e2ee/e2eeType"; vi.mock("@livekit/components-core"); -const localRtcMember = mockMembership("@carol:example.org", "CCCC"); -const aliceRtcMember = mockMembership("@alice:example.org", "AAAA"); -const bobRtcMember = mockMembership("@bob:example.org", "BBBB"); -const daveRtcMember = mockMembership("@dave:example.org", "DDDD"); +const localRtcMember = mockRtcMembership("@carol:example.org", "CCCC"); +const aliceRtcMember = mockRtcMembership("@alice:example.org", "AAAA"); +const bobRtcMember = mockRtcMembership("@bob:example.org", "BBBB"); +const daveRtcMember = mockRtcMembership("@dave:example.org", "DDDD"); const alice = mockRoomMember(aliceRtcMember); const bob = mockRoomMember(bobRtcMember); diff --git a/src/state/MediaViewModel.test.ts b/src/state/MediaViewModel.test.ts index 0ff5b5e6..c4e0bee6 100644 --- a/src/state/MediaViewModel.test.ts +++ b/src/state/MediaViewModel.test.ts @@ -8,13 +8,13 @@ Please see LICENSE in the repository root for full details. import { expect, test, vi } from "vitest"; import { - mockMembership, + mockRtcMembership, withLocalMedia, withRemoteMedia, withTestScheduler, } from "../utils/test"; -const rtcMembership = mockMembership("@alice:example.org", "AAAA"); +const rtcMembership = mockRtcMembership("@alice:example.org", "AAAA"); test("control a participant's volume", async () => { const setVolumeSpy = vi.fn(); diff --git a/src/tile/GridTile.test.tsx b/src/tile/GridTile.test.tsx index 5e668078..c0cf9c48 100644 --- a/src/tile/GridTile.test.tsx +++ b/src/tile/GridTile.test.tsx @@ -13,7 +13,7 @@ import { of } from "rxjs"; import { MatrixRTCSession } from "matrix-js-sdk/src/matrixrtc/MatrixRTCSession"; import { GridTile } from "./GridTile"; -import { mockMembership, withRemoteMedia } from "../utils/test"; +import { mockRtcMembership, withRemoteMedia } from "../utils/test"; import { GridTileViewModel } from "../state/TileViewModel"; import { ReactionsProvider } from "../useReactions"; @@ -25,7 +25,7 @@ global.IntersectionObserver = class MockIntersectionObserver { test("GridTile is accessible", async () => { await withRemoteMedia( - mockMembership("@alice:example.org", "AAAA"), + mockRtcMembership("@alice:example.org", "AAAA"), { rawDisplayName: "Alice", getMxcAvatarUrl: () => "mxc://adfsg", diff --git a/src/tile/SpotlightTile.test.tsx b/src/tile/SpotlightTile.test.tsx index 1b29cb9f..29b574a2 100644 --- a/src/tile/SpotlightTile.test.tsx +++ b/src/tile/SpotlightTile.test.tsx @@ -12,7 +12,11 @@ import userEvent from "@testing-library/user-event"; import { of } from "rxjs"; import { SpotlightTile } from "./SpotlightTile"; -import { mockMembership, withLocalMedia, withRemoteMedia } from "../utils/test"; +import { + mockRtcMembership, + withLocalMedia, + withRemoteMedia, +} from "../utils/test"; import { SpotlightTileViewModel } from "../state/TileViewModel"; global.IntersectionObserver = class MockIntersectionObserver { @@ -22,7 +26,7 @@ global.IntersectionObserver = class MockIntersectionObserver { test("SpotlightTile is accessible", async () => { await withRemoteMedia( - mockMembership("@alice:example.org", "AAAA"), + mockRtcMembership("@alice:example.org", "AAAA"), { rawDisplayName: "Alice", getMxcAvatarUrl: () => "mxc://adfsg", @@ -30,7 +34,7 @@ test("SpotlightTile is accessible", async () => { {}, async (vm1) => { await withLocalMedia( - mockMembership("@bob:example.org", "BBBB"), + mockRtcMembership("@bob:example.org", "BBBB"), { rawDisplayName: "Bob", getMxcAvatarUrl: () => "mxc://dlskf", diff --git a/src/utils/test.ts b/src/utils/test.ts index 25f60d14..cf1d9ec1 100644 --- a/src/utils/test.ts +++ b/src/utils/test.ts @@ -109,7 +109,7 @@ function mockEmitter(): EmitterMock { }; } -export function mockMembership( +export function mockRtcMembership( user: string | RoomMember, deviceId: string, callId = "",