From 14919cae13aef9baa962473828a04e0252ea20ed Mon Sep 17 00:00:00 2001 From: Timo Date: Mon, 4 Nov 2024 16:36:13 +0100 Subject: [PATCH] linter and tests --- src/room/InCallView.tsx | 7 +------ src/utils/test.ts | 11 ++++++++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/room/InCallView.tsx b/src/room/InCallView.tsx index 66ef263d..ab54f856 100644 --- a/src/room/InCallView.tsx +++ b/src/room/InCallView.tsx @@ -126,12 +126,7 @@ export const ActiveCall: FC = (props) => { setVm(vm); return (): void => vm.destroy(); } - }, [ - props.rtcSession, - livekitRoom, - props.e2eeSystem, - connStateObservable, - ]); + }, [props.rtcSession, livekitRoom, props.e2eeSystem, connStateObservable]); if (livekitRoom === undefined || vm === null) return null; diff --git a/src/utils/test.ts b/src/utils/test.ts index 85e72d38..dbe3cb46 100644 --- a/src/utils/test.ts +++ b/src/utils/test.ts @@ -4,7 +4,7 @@ Copyright 2023, 2024 New Vector Ltd. SPDX-License-Identifier: AGPL-3.0-only Please see LICENSE in the repository root for full details. */ -import { map } from "rxjs"; +import { map, of } from "rxjs"; import { RunHelpers, TestScheduler } from "rxjs/testing"; import { expect, vi } from "vitest"; import { RoomMember, Room as MatrixRoom } from "matrix-js-sdk/src/matrix"; @@ -15,6 +15,7 @@ import { RemoteTrackPublication, Room as LivekitRoom, } from "livekit-client"; +import { MatrixRTCSession } from "matrix-js-sdk/src/matrixrtc"; import { LocalUserMediaViewModel, @@ -117,15 +118,17 @@ export function mockLocalParticipant( export async function withLocalMedia( member: Partial, + rtcSession: MatrixRTCSession, continuation: (vm: LocalUserMediaViewModel) => void | Promise, ): Promise { const vm = new LocalUserMediaViewModel( "local", mockMember(member), - mockLocalParticipant({}), + of(mockLocalParticipant({})), { kind: E2eeType.PER_PARTICIPANT, }, + rtcSession, ); try { await continuation(vm); @@ -150,15 +153,17 @@ export function mockRemoteParticipant( export async function withRemoteMedia( member: Partial, participant: Partial, + rtcSession: MatrixRTCSession, continuation: (vm: RemoteUserMediaViewModel) => void | Promise, ): Promise { const vm = new RemoteUserMediaViewModel( "remote", mockMember(member), - mockRemoteParticipant(participant), + of(mockRemoteParticipant(participant)), { kind: E2eeType.PER_PARTICIPANT, }, + rtcSession, ); try { await continuation(vm);