a tiny bit of tests lint fixes.
Signed-off-by: Timo K <toger5@hotmail.de>
This commit is contained in:
@@ -5,7 +5,6 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
|
|||||||
Please see LICENSE in the repository root for full details.
|
Please see LICENSE in the repository root for full details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { ConnectionState } from "livekit-client";
|
|
||||||
import {
|
import {
|
||||||
type CallMembership,
|
type CallMembership,
|
||||||
type MatrixRTCSession,
|
type MatrixRTCSession,
|
||||||
@@ -27,19 +26,13 @@ import {
|
|||||||
type CallViewModelOptions,
|
type CallViewModelOptions,
|
||||||
} from "../state/CallViewModel";
|
} from "../state/CallViewModel";
|
||||||
import {
|
import {
|
||||||
mockLivekitRoom,
|
|
||||||
mockMatrixRoom,
|
mockMatrixRoom,
|
||||||
mockMediaDevices,
|
mockMediaDevices,
|
||||||
|
mockMuteStates,
|
||||||
MockRTCSession,
|
MockRTCSession,
|
||||||
} from "./test";
|
} from "./test";
|
||||||
import {
|
import { aliceRtcMember, localRtcMember } from "./test-fixtures";
|
||||||
aliceRtcMember,
|
|
||||||
aliceParticipant,
|
|
||||||
localParticipant,
|
|
||||||
localRtcMember,
|
|
||||||
} from "./test-fixtures";
|
|
||||||
import { type RaisedHandInfo, type ReactionInfo } from "../reactions";
|
import { type RaisedHandInfo, type ReactionInfo } from "../reactions";
|
||||||
import { constant } from "../state/Behavior";
|
|
||||||
|
|
||||||
export function getBasicRTCSession(
|
export function getBasicRTCSession(
|
||||||
members: RoomMember[],
|
members: RoomMember[],
|
||||||
@@ -141,23 +134,20 @@ export function getBasicCallViewModelEnvironment(
|
|||||||
const handRaisedSubject$ = new BehaviorSubject({});
|
const handRaisedSubject$ = new BehaviorSubject({});
|
||||||
const reactionsSubject$ = new BehaviorSubject({});
|
const reactionsSubject$ = new BehaviorSubject({});
|
||||||
|
|
||||||
const remoteParticipants$ = of([aliceParticipant]);
|
// const remoteParticipants$ = of([aliceParticipant]);
|
||||||
const livekitRoom = mockLivekitRoom(
|
|
||||||
{ localParticipant },
|
|
||||||
{ remoteParticipants$ },
|
|
||||||
);
|
|
||||||
const vm = new CallViewModel(
|
const vm = new CallViewModel(
|
||||||
rtcSession as unknown as MatrixRTCSession,
|
rtcSession as unknown as MatrixRTCSession,
|
||||||
matrixRoom,
|
matrixRoom,
|
||||||
livekitRoom,
|
|
||||||
mockMediaDevices({}),
|
mockMediaDevices({}),
|
||||||
|
mockMuteStates(),
|
||||||
{
|
{
|
||||||
encryptionSystem: { kind: E2eeType.PER_PARTICIPANT },
|
encryptionSystem: { kind: E2eeType.PER_PARTICIPANT },
|
||||||
...callViewModelOptions,
|
...callViewModelOptions,
|
||||||
},
|
},
|
||||||
constant(ConnectionState.Connected),
|
|
||||||
handRaisedSubject$,
|
handRaisedSubject$,
|
||||||
reactionsSubject$,
|
reactionsSubject$,
|
||||||
|
of({ processor: undefined, supported: false }),
|
||||||
);
|
);
|
||||||
return {
|
return {
|
||||||
vm,
|
vm,
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ import { Config } from "../config/Config";
|
|||||||
import { type MediaDevices } from "../state/MediaDevices";
|
import { type MediaDevices } from "../state/MediaDevices";
|
||||||
import { type Behavior, constant } from "../state/Behavior";
|
import { type Behavior, constant } from "../state/Behavior";
|
||||||
import { ObservableScope } from "../state/ObservableScope";
|
import { ObservableScope } from "../state/ObservableScope";
|
||||||
import { Handler, MuteStates } from "../state/MuteStates";
|
import { MuteStates } from "../state/MuteStates";
|
||||||
|
|
||||||
export function withFakeTimers(continuation: () => void): void {
|
export function withFakeTimers(continuation: () => void): void {
|
||||||
vi.useFakeTimers();
|
vi.useFakeTimers();
|
||||||
|
|||||||
Reference in New Issue
Block a user