mirror of
https://github.com/vector-im/element-call.git
synced 2026-05-13 10:34:37 +00:00
update tests
This commit is contained in:
@@ -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");
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user