Skip to content

Commit d0a7f0c

Browse files
test: add tests for onMenu property access
Co-authored-by: Junie <junie@jetbrains.com>
1 parent 8623bf3 commit d0a7f0c

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

test/unit/controller/BootApplication/BootApplication.menu.unit.test.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,18 @@ describe("BootApplication: Menu Handling", () => {
5757

5858
expect(capturedEvent).toBe(event);
5959
});
60+
61+
it("should return proxy when accessed as a property", () => {
62+
const app = new BootApplication({ controllers: [], providers: [] });
63+
const menu = (app as any).onMenu;
64+
expect(typeof menu).toBe("function");
65+
expect(typeof menu.openSidebarHome).toBe("function");
66+
});
67+
68+
it("should return same proxy when called as a function", () => {
69+
const app = new BootApplication({ controllers: [], providers: [] });
70+
const menu = app.onMenu;
71+
const result = (menu as any)();
72+
expect(result).toBe(menu);
73+
});
6074
});

0 commit comments

Comments
 (0)