diff --git a/browser_tests/ComfyPage.ts b/browser_tests/ComfyPage.ts index 7426b082..fc301910 100644 --- a/browser_tests/ComfyPage.ts +++ b/browser_tests/ComfyPage.ts @@ -230,6 +230,10 @@ class Topbar { .allInnerTexts() } + async openSubmenuMobile() { + await this.page.locator('.p-menubar-mobile').click() + } + async triggerTopbarCommand(path: string[]) { if (path.length < 2) { throw new Error('Path is too short') diff --git a/browser_tests/menu.spec.ts b/browser_tests/menu.spec.ts index eab80425..3fd94cea 100644 --- a/browser_tests/menu.spec.ts +++ b/browser_tests/menu.spec.ts @@ -454,6 +454,21 @@ test.describe('Menu', () => { }) }) + test.describe('Topbar submmenus', () => { + test('@mobile Items fully visible on mobile screen width', async ({ + comfyPage + }) => { + await comfyPage.menu.topbar.openSubmenuMobile() + const topLevelMenuItem = comfyPage.page + .locator('a.p-menubar-item-link') + .first() + const isTextCutoff = await topLevelMenuItem.evaluate((el) => { + return el.scrollWidth > el.clientWidth + }) + expect(isTextCutoff).toBe(false) + }) + }) + // Only test 'Top' to reduce test time. // ['Bottom', 'Top'] ;['Top'].forEach(async (position) => {