From 79ead7ba62312e451b167ac3a7111bd74c5c4e90 Mon Sep 17 00:00:00 2001 From: "Bingxi Zhao (Frank)" <13051345080@163.com> Date: Wed, 2 Dec 2026 05:48:16 -0500 Subject: [PATCH] test(settings): use the isolated settings API fixture for phone navigation (#2918) --- web/tests/e2e/settings-narrow.audit.ts | 15 --------------- web/tests/e2e/settings-navigation.audit.ts | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 15 deletions(-) delete mode 100644 web/tests/e2e/settings-narrow.audit.ts diff --git a/web/tests/e2e/settings-narrow.audit.ts b/web/tests/e2e/settings-narrow.audit.ts deleted file mode 100644 index df0071843..000000000 --- a/web/tests/e2e/settings-narrow.audit.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { expect, test } from "@playwright/test"; - -test("preferences fit a phone and expose navigation on demand", async ({ page }) => { - await page.setViewportSize({ width: 390, height: 844 }); - await page.goto("/settings", { waitUntil: "domcontentloaded" }); - const shell = page.locator("[data-settings-shell]"); - await expect(shell).toBeVisible(); - const bounds = await shell.boundingBox(); - expect(bounds?.width).toBeLessThanOrEqual(390); - expect(await shell.evaluate(el => el.scrollWidth <= el.clientWidth)).toBe(true); - const toggle = shell.getByRole("button", { name: "Settings sections" }); - await expect(toggle).toBeVisible(); - await toggle.click(); - await expect(page.getByRole("dialog").getByRole("navigation", { name: "Settings sections" })).toBeVisible(); -}); diff --git a/web/tests/e2e/settings-navigation.audit.ts b/web/tests/e2e/settings-navigation.audit.ts index fc432b513..8d272a62f 100644 --- a/web/tests/e2e/settings-navigation.audit.ts +++ b/web/tests/e2e/settings-navigation.audit.ts @@ -634,3 +634,18 @@ test("a new provider can be tested with only a key and supplies discovered model expect(llm.profiles[2].models).toHaveLength(1); expect(llm.profiles[2].models[0].model).toBe("chosen-model"); }); + +test("preferences fit a phone and expose navigation on demand", async ({ page }) => { + await mockSettings(page); + await page.setViewportSize({ width: 390, height: 844 }); + await page.goto("/settings", { waitUntil: "domcontentloaded" }); + const shell = page.locator("[data-settings-shell]"); + await expect(shell).toBeVisible(); + const bounds = await shell.boundingBox(); + expect(bounds?.width).toBeLessThanOrEqual(390); + expect(await shell.evaluate(el => el.scrollWidth <= el.clientWidth)).toBe(true); + const toggle = shell.getByRole("button", { name: "Settings sections" }); + await expect(toggle).toBeVisible(); + await toggle.click(); + await expect(page.getByRole("dialog").getByRole("navigation", { name: "Settings sections" })).toBeVisible(); +});