add initializeWidget to tests.
This commit is contained in:
@@ -18,7 +18,8 @@ import { getBasicCallViewModelEnvironment } from "../utils/test-viewmodel";
|
|||||||
import { alice, local, localRtcMember } from "../utils/test-fixtures";
|
import { alice, local, localRtcMember } from "../utils/test-fixtures";
|
||||||
import { type MockRTCSession } from "../utils/test";
|
import { type MockRTCSession } from "../utils/test";
|
||||||
import { ReactionsSenderProvider } from "../reactions/useReactionsSender";
|
import { ReactionsSenderProvider } from "../reactions/useReactionsSender";
|
||||||
|
import { initializeWidget } from "../widget";
|
||||||
|
initializeWidget();
|
||||||
vi.mock("livekit-client/e2ee-worker?worker");
|
vi.mock("livekit-client/e2ee-worker?worker");
|
||||||
|
|
||||||
const localIdent = `${localRtcMember.userId}:${localRtcMember.deviceId}`;
|
const localIdent = `${localRtcMember.userId}:${localRtcMember.deviceId}`;
|
||||||
|
|||||||
@@ -28,7 +28,8 @@ import {
|
|||||||
mockRemoteParticipant,
|
mockRemoteParticipant,
|
||||||
mockTrack,
|
mockTrack,
|
||||||
} from "../utils/test";
|
} from "../utils/test";
|
||||||
|
import { initializeWidget } from "../widget";
|
||||||
|
initializeWidget();
|
||||||
export const TestAudioContextConstructor = vi.fn(() => testAudioContext);
|
export const TestAudioContextConstructor = vi.fn(() => testAudioContext);
|
||||||
|
|
||||||
const MediaDevicesProvider = MediaDevicesContext.MediaDevicesContext.Provider;
|
const MediaDevicesProvider = MediaDevicesContext.MediaDevicesContext.Provider;
|
||||||
|
|||||||
@@ -39,7 +39,8 @@ import {
|
|||||||
localRtcMember,
|
localRtcMember,
|
||||||
} from "../utils/test-fixtures";
|
} from "../utils/test-fixtures";
|
||||||
import { MAX_PARTICIPANT_COUNT_FOR_SOUND } from "../state/CallViewModel/CallViewModel";
|
import { MAX_PARTICIPANT_COUNT_FOR_SOUND } from "../state/CallViewModel/CallViewModel";
|
||||||
|
import { initializeWidget } from "../widget";
|
||||||
|
initializeWidget();
|
||||||
vitest.mock("livekit-client/e2ee-worker?worker");
|
vitest.mock("livekit-client/e2ee-worker?worker");
|
||||||
vitest.mock("../useAudioContext");
|
vitest.mock("../useAudioContext");
|
||||||
vitest.mock("../soundUtils");
|
vitest.mock("../soundUtils");
|
||||||
|
|||||||
@@ -43,7 +43,8 @@ import { useRoomEncryptionSystem } from "../e2ee/sharedKeyManagement";
|
|||||||
import { LivekitRoomAudioRenderer } from "../livekit/MatrixAudioRenderer";
|
import { LivekitRoomAudioRenderer } from "../livekit/MatrixAudioRenderer";
|
||||||
import { MediaDevicesContext } from "../MediaDevicesContext";
|
import { MediaDevicesContext } from "../MediaDevicesContext";
|
||||||
import { HeaderStyle } from "../UrlParams";
|
import { HeaderStyle } from "../UrlParams";
|
||||||
|
import { initializeWidget } from "../widget";
|
||||||
|
initializeWidget();
|
||||||
vi.hoisted(
|
vi.hoisted(
|
||||||
() =>
|
() =>
|
||||||
(global.ImageData = class MockImageData {
|
(global.ImageData = class MockImageData {
|
||||||
|
|||||||
@@ -37,6 +37,8 @@ import {
|
|||||||
local,
|
local,
|
||||||
localRtcMember,
|
localRtcMember,
|
||||||
} from "../utils/test-fixtures";
|
} from "../utils/test-fixtures";
|
||||||
|
import { initializeWidget } from "../widget";
|
||||||
|
initializeWidget();
|
||||||
|
|
||||||
function TestComponent({ vm }: { vm: CallViewModel }): ReactNode {
|
function TestComponent({ vm }: { vm: CallViewModel }): ReactNode {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ import {
|
|||||||
bobRtcMember,
|
bobRtcMember,
|
||||||
} from "../utils/test-fixtures";
|
} from "../utils/test-fixtures";
|
||||||
import { getBasicCallViewModelEnvironment } from "../utils/test-viewmodel";
|
import { getBasicCallViewModelEnvironment } from "../utils/test-viewmodel";
|
||||||
|
import { initializeWidget } from "../widget";
|
||||||
|
initializeWidget();
|
||||||
|
|
||||||
vi.mock("livekit-client/e2ee-worker?worker");
|
vi.mock("livekit-client/e2ee-worker?worker");
|
||||||
|
|
||||||
|
|||||||
@@ -62,6 +62,9 @@ import { getValue } from "../../utils/observable.ts";
|
|||||||
import { type Behavior, constant } from "../Behavior.ts";
|
import { type Behavior, constant } from "../Behavior.ts";
|
||||||
import { withCallViewModel as withCallViewModelInMode } from "./CallViewModelTestUtils.ts";
|
import { withCallViewModel as withCallViewModelInMode } from "./CallViewModelTestUtils.ts";
|
||||||
import { MatrixRTCMode } from "../../settings/settings.ts";
|
import { MatrixRTCMode } from "../../settings/settings.ts";
|
||||||
|
import { initializeWidget } from "../../widget.ts";
|
||||||
|
|
||||||
|
initializeWidget();
|
||||||
|
|
||||||
vi.mock("rxjs", async (importOriginal) => ({
|
vi.mock("rxjs", async (importOriginal) => ({
|
||||||
...(await importOriginal()),
|
...(await importOriginal()),
|
||||||
|
|||||||
@@ -40,6 +40,9 @@ import { ConnectionManagerData } from "../remoteMembers/ConnectionManager";
|
|||||||
import { ConnectionState, type Connection } from "../remoteMembers/Connection";
|
import { ConnectionState, type Connection } from "../remoteMembers/Connection";
|
||||||
import { type Publisher } from "./Publisher";
|
import { type Publisher } from "./Publisher";
|
||||||
import { type LocalTransportWithSFUConfig } from "./LocalTransport";
|
import { type LocalTransportWithSFUConfig } from "./LocalTransport";
|
||||||
|
import { initializeWidget } from "../../../widget";
|
||||||
|
|
||||||
|
initializeWidget();
|
||||||
|
|
||||||
const MATRIX_RTC_MODE = MatrixRTCMode.Legacy;
|
const MATRIX_RTC_MODE = MatrixRTCMode.Legacy;
|
||||||
const getUrlParams = vi.hoisted(() => vi.fn(() => ({})));
|
const getUrlParams = vi.hoisted(() => vi.fn(() => ({})));
|
||||||
|
|||||||
@@ -20,6 +20,8 @@ import {
|
|||||||
import { constant } from "./Behavior";
|
import { constant } from "./Behavior";
|
||||||
import { ObservableScope } from "./ObservableScope";
|
import { ObservableScope } from "./ObservableScope";
|
||||||
import { flushPromises, mockMediaDevices } from "../utils/test";
|
import { flushPromises, mockMediaDevices } from "../utils/test";
|
||||||
|
import { initializeWidget } from "../widget";
|
||||||
|
initializeWidget();
|
||||||
|
|
||||||
const getUrlParams = vi.hoisted(() => vi.fn(() => ({})));
|
const getUrlParams = vi.hoisted(() => vi.fn(() => ({})));
|
||||||
vi.mock("../UrlParams", () => ({ getUrlParams }));
|
vi.mock("../UrlParams", () => ({ getUrlParams }));
|
||||||
|
|||||||
Reference in New Issue
Block a user