refactor and fix test

This commit is contained in:
Ryan Di
2025-10-27 21:44:15 +11:00
parent 67a37175a6
commit 2131b376cd
8 changed files with 99 additions and 124 deletions

View File

@@ -17,7 +17,6 @@ describe("Test MobileMenu", () => {
beforeEach(async () => {
await render(<ExcalidrawApp />);
// @ts-ignore
h.app.refreshEditorInterface();
});
@@ -26,20 +25,7 @@ describe("Test MobileMenu", () => {
});
it("should set editor interface correctly", () => {
expect(h.app.editorInterface).toMatchInlineSnapshot(`
{
"canFitSidebar": false,
"desktopUIMode": "full",
"formFactor": "desktop",
"isLandscape": true,
"isTouchScreen": false,
"userAgent": {
"isMobileDevice": false,
"platform": "other",
"raw": "Mozilla/5.0 (darwin) AppleWebKit/537.36 (KHTML, like Gecko) jsdom/22.1.0",
},
}
`);
expect(h.app.editorInterface.formFactor).toBe("phone");
});
it("should initialize with welcome screen and hide once user interacts", async () => {