mirror of
https://github.com/Novaloop-AG/healthchat-web.git
synced 2026-11-24 18:59:17 +00:00
Move mediaDevices mock out of setupManualMocks (#11413)
* Move `mediaDevices` mock out of `setupManualMocks` This doesn't work well in test suites with multiple tests, because the `mockReturnValue` is reset for subsequent tests. In any case, having it mocked out automagically is *magical*. Let's make it opt-in. * clarify ts-ignore
This commit is contained in:
committed by
GitHub
parent
d569ba0cfe
commit
3fda0299a5
@@ -30,6 +30,7 @@ import {
|
||||
useMockedCalls,
|
||||
MockedCall,
|
||||
setupAsyncStoreWithClient,
|
||||
useMockMediaDevices,
|
||||
} from "../../../test-utils";
|
||||
import { MatrixClientPeg } from "../../../../src/MatrixClientPeg";
|
||||
import { CallView as _CallView } from "../../../../src/components/views/voip/CallView";
|
||||
@@ -41,7 +42,7 @@ import MediaDeviceHandler from "../../../../src/MediaDeviceHandler";
|
||||
|
||||
const CallView = wrapInMatrixClientContext(_CallView);
|
||||
|
||||
describe("CallLobby", () => {
|
||||
describe("CallView", () => {
|
||||
useMockedCalls();
|
||||
jest.spyOn(HTMLMediaElement.prototype, "play").mockImplementation(async () => {});
|
||||
|
||||
@@ -50,7 +51,7 @@ describe("CallLobby", () => {
|
||||
let alice: RoomMember;
|
||||
|
||||
beforeEach(() => {
|
||||
mocked(navigator.mediaDevices.enumerateDevices).mockResolvedValue([]);
|
||||
useMockMediaDevices();
|
||||
|
||||
stubClient();
|
||||
client = mocked(MatrixClientPeg.safeGet());
|
||||
|
||||
Reference in New Issue
Block a user