mirror of
https://github.com/vector-im/element-web.git
synced 2026-05-05 20:26:19 +02:00
Fix jest test
This commit is contained in:
parent
3090f4fc54
commit
b8e8094aca
@ -15,7 +15,7 @@ jest.useFakeTimers();
|
||||
describe("CollapseOnWindowResizeBehaviour", () => {
|
||||
it("Should collapse/expand the panel when the window is resized", () => {
|
||||
const collapseHandler = new MockCollapseHandler() as unknown as CollapseHandler;
|
||||
new CollapseOnWindowResizeBehaviour(collapseHandler);
|
||||
const behaviour = new CollapseOnWindowResizeBehaviour(collapseHandler);
|
||||
// Making the window smaller should collapse the panel.
|
||||
UIStore.instance.emit(UI_EVENTS.WidthDecreased, 750);
|
||||
expect(collapseHandler.collapse).toHaveBeenCalledTimes(1);
|
||||
@ -52,7 +52,7 @@ describe("CollapseOnWindowResizeBehaviour", () => {
|
||||
|
||||
it("should return correct shouldStartCollapsed", () => {
|
||||
const collapseHandler = new MockCollapseHandler();
|
||||
new CollapseOnWindowResizeBehaviour(collapseHandler as unknown as CollapseHandler);
|
||||
const behaviour = new CollapseOnWindowResizeBehaviour(collapseHandler as unknown as CollapseHandler);
|
||||
// When the window is smaller than 768px, start collapsed.
|
||||
UIStore.instance.windowWidth = 750;
|
||||
expect(CollapseOnWindowResizeBehaviour.shouldStartCollapsed()).toBe(true);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user