mirror of
https://github.com/vector-im/element-call.git
synced 2026-02-08 04:19:11 +00:00
start fixing CallViewModel tests.
Signed-off-by: Timo K <toger5@hotmail.de>
This commit is contained in:
@@ -53,6 +53,7 @@ import { Config } from "../config/Config";
|
||||
import { type MediaDevices } from "../state/MediaDevices";
|
||||
import { type Behavior, constant } from "../state/Behavior";
|
||||
import { ObservableScope } from "../state/ObservableScope";
|
||||
import { Handler, MuteStates } from "../state/MuteStates";
|
||||
|
||||
export function withFakeTimers(continuation: () => void): void {
|
||||
vi.useFakeTimers();
|
||||
@@ -417,3 +418,10 @@ export function mockMediaDevices(data: Partial<MediaDevices>): MediaDevices {
|
||||
...data,
|
||||
} as MediaDevices;
|
||||
}
|
||||
|
||||
export function mockMuteStates(
|
||||
joined$: Observable<boolean> = of(true),
|
||||
): MuteStates {
|
||||
const observableScope = new ObservableScope();
|
||||
return new MuteStates(observableScope, mockMediaDevices({}), joined$);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user