start fixing CallViewModel tests.

Signed-off-by: Timo K <toger5@hotmail.de>
This commit is contained in:
Timo K
2025-09-19 18:01:45 +02:00
parent 41e152f420
commit d9fe31039f
4 changed files with 15 additions and 19 deletions

View File

@@ -210,6 +210,7 @@ export const InCallView: FC<InCallViewProps> = ({
// annoyingly we don't get the disconnection reason this way,
// only by listening for the emitted event
// This needs to be done differential. with the vm connection state we start with Disconnected.
// TODO-MULTI-SFU decide how to handle this properly
// if (connectionState === ConnectionState.Disconnected)
// throw new ConnectionLostError();

View File

@@ -9,15 +9,8 @@ import { expect, describe, it, vi, beforeAll } from "vitest";
import { render } from "@testing-library/react";
import { type MatrixInfo, VideoPreview } from "./VideoPreview";
import { type MuteStates } from "./MuteStates";
import { E2eeType } from "../e2ee/e2eeType";
function mockMuteStates({ audio = true, video = true } = {}): MuteStates {
return {
audio: { enabled: audio, setEnabled: vi.fn() },
video: { enabled: video, setEnabled: vi.fn() },
};
}
import { mockMuteStates } from "../utils/test";
describe("VideoPreview", () => {
const matrixInfo: MatrixInfo = {
@@ -49,7 +42,7 @@ describe("VideoPreview", () => {
const { queryByRole } = render(
<VideoPreview
matrixInfo={matrixInfo}
muteStates={mockMuteStates({ video: false })}
muteStates={mockMuteStates()}
videoTrack={null}
children={<></>}
/>,
@@ -61,7 +54,7 @@ describe("VideoPreview", () => {
const { queryByRole } = render(
<VideoPreview
matrixInfo={matrixInfo}
muteStates={mockMuteStates({ video: true })}
muteStates={mockMuteStates()}
videoTrack={null}
children={<></>}
/>,