update tests

This commit is contained in:
Timo K
2026-05-11 18:18:40 +02:00
parent ff3b4c6ff4
commit 102542c1b0
2 changed files with 9 additions and 19 deletions

View File

@@ -87,12 +87,12 @@ const twoMicsAndOneCamMediaDevices = mockMediaDevices({
describe("createCallFooterViewModel", () => {
describe("audioOptions and videoOptions", () => {
it("are empty when the layout is PiP on desktop", () => {
platformMock.mockReturnValue("desktop");
function checkEmptyFor(platform: string, layout: Layout): void {
platformMock.mockReturnValue(platform);
const vm = createCallFooterViewModel(
testScope(),
buildMinimalCallViewModel(pipLayout),
buildMinimalCallViewModel(layout),
mockMuteStates(),
twoMicsAndOneCamMediaDevices,
/* openSettings */ undefined,
@@ -101,23 +101,13 @@ describe("createCallFooterViewModel", () => {
expect(vm.audioOptions$?.value).toEqual([]);
expect(vm.videoOptions$?.value).toEqual([]);
}
it("are empty when both the platform is iOS", () => {
checkEmptyFor("ios", gridLayout);
it("are empty when both the layout is pip", () => {
checkEmptyFor("desktop", pipLayout);
});
it("are empty when the platform is iOS regardless of layout", () => {
platformMock.mockReturnValue("ios");
const vm = createCallFooterViewModel(
testScope(),
buildMinimalCallViewModel(gridLayout),
mockMuteStates(),
twoMicsAndOneCamMediaDevices,
/* openSettings */ undefined,
/* reactionIdentifier */ undefined,
);
expect(vm.audioOptions$?.value).toEqual([]);
expect(vm.videoOptions$?.value).toEqual([]);
});
it("are populated when the platform is desktop and the layout is not PiP", () => {
platformMock.mockReturnValue("desktop");

View File

@@ -61,7 +61,7 @@ export interface WidgetHelpers {
* is initialized with `initializeWidget`. This should happen at the top level because the widget messaging
* needs to be set up ASAP on load to ensure it doesn't miss any requests.
*/
export let widget: WidgetHelpers | null;
export let widget: WidgetHelpers | null = null;
/**
* Should be called as soon as possible on app start. (In the initilizer before react)