mirror of
https://github.com/vector-im/element-call.git
synced 2026-02-26 05:17:04 +00:00
start fixing CallViewModel tests.
Signed-off-by: Timo K <toger5@hotmail.de>
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
@@ -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={<></>}
|
||||
/>,
|
||||
|
||||
Reference in New Issue
Block a user