Fix jest test

This commit is contained in:
R Midhun Suresh 2026-03-29 20:16:44 +05:30
parent 3090f4fc54
commit b8e8094aca
No known key found for this signature in database

View File

@ -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);