linter and tests

This commit is contained in:
Timo 2024-11-04 16:36:13 +01:00
parent 1ab4d50bab
commit 14919cae13
2 changed files with 9 additions and 9 deletions

View File

@ -126,12 +126,7 @@ export const ActiveCall: FC<ActiveCallProps> = (props) => {
setVm(vm); setVm(vm);
return (): void => vm.destroy(); return (): void => vm.destroy();
} }
}, [ }, [props.rtcSession, livekitRoom, props.e2eeSystem, connStateObservable]);
props.rtcSession,
livekitRoom,
props.e2eeSystem,
connStateObservable,
]);
if (livekitRoom === undefined || vm === null) return null; if (livekitRoom === undefined || vm === null) return null;

View File

@ -4,7 +4,7 @@ Copyright 2023, 2024 New Vector Ltd.
SPDX-License-Identifier: AGPL-3.0-only SPDX-License-Identifier: AGPL-3.0-only
Please see LICENSE in the repository root for full details. 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 { RunHelpers, TestScheduler } from "rxjs/testing";
import { expect, vi } from "vitest"; import { expect, vi } from "vitest";
import { RoomMember, Room as MatrixRoom } from "matrix-js-sdk/src/matrix"; import { RoomMember, Room as MatrixRoom } from "matrix-js-sdk/src/matrix";
@ -15,6 +15,7 @@ import {
RemoteTrackPublication, RemoteTrackPublication,
Room as LivekitRoom, Room as LivekitRoom,
} from "livekit-client"; } from "livekit-client";
import { MatrixRTCSession } from "matrix-js-sdk/src/matrixrtc";
import { import {
LocalUserMediaViewModel, LocalUserMediaViewModel,
@ -117,15 +118,17 @@ export function mockLocalParticipant(
export async function withLocalMedia( export async function withLocalMedia(
member: Partial<RoomMember>, member: Partial<RoomMember>,
rtcSession: MatrixRTCSession,
continuation: (vm: LocalUserMediaViewModel) => void | Promise<void>, continuation: (vm: LocalUserMediaViewModel) => void | Promise<void>,
): Promise<void> { ): Promise<void> {
const vm = new LocalUserMediaViewModel( const vm = new LocalUserMediaViewModel(
"local", "local",
mockMember(member), mockMember(member),
mockLocalParticipant({}), of(mockLocalParticipant({})),
{ {
kind: E2eeType.PER_PARTICIPANT, kind: E2eeType.PER_PARTICIPANT,
}, },
rtcSession,
); );
try { try {
await continuation(vm); await continuation(vm);
@ -150,15 +153,17 @@ export function mockRemoteParticipant(
export async function withRemoteMedia( export async function withRemoteMedia(
member: Partial<RoomMember>, member: Partial<RoomMember>,
participant: Partial<RemoteParticipant>, participant: Partial<RemoteParticipant>,
rtcSession: MatrixRTCSession,
continuation: (vm: RemoteUserMediaViewModel) => void | Promise<void>, continuation: (vm: RemoteUserMediaViewModel) => void | Promise<void>,
): Promise<void> { ): Promise<void> {
const vm = new RemoteUserMediaViewModel( const vm = new RemoteUserMediaViewModel(
"remote", "remote",
mockMember(member), mockMember(member),
mockRemoteParticipant(participant), of(mockRemoteParticipant(participant)),
{ {
kind: E2eeType.PER_PARTICIPANT, kind: E2eeType.PER_PARTICIPANT,
}, },
rtcSession,
); );
try { try {
await continuation(vm); await continuation(vm);