mirror of
https://github.com/HKUDS/DeepTutor.git
synced 2026-12-05 08:10:00 +08:00
test(settings): use the isolated settings API fixture for phone navigation (#2918)
This commit is contained in:
@@ -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();
|
||||
});
|
||||
@@ -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();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user