test(settings): use the isolated settings API fixture for phone navigation (#2918)

This commit is contained in:
Bingxi Zhao (Frank)
2026-12-02 05:48:16 -05:00
parent e3f45f624e
commit 79ead7ba62
2 changed files with 15 additions and 15 deletions

View File

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

View File

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