Skip to content

Commit cea5774

Browse files
committed
test: refresh mobile settings homepage preview coverage
1 parent 209d115 commit cea5774

4 files changed

Lines changed: 12 additions & 4 deletions

File tree

e2e-ui/fixtures/scene-runner.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ async function openSettingsSection(
4141
const index = sectionOrder[section];
4242

4343
if (device === "mobile") {
44-
await page.locator(".settings-mobile-item").nth(index).click();
44+
await page.locator(".settings-mobile-root .settings-mobile-item").nth(index).click();
4545
await page.locator(".settings-content--mobile, .settings-content").first().waitFor();
4646
return;
4747
}

packages/web/src/ui-preview/catalog.test.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,10 @@ describe("UI preview catalog", () => {
194194
renderScene("settings-mobile-root", "mobile");
195195

196196
expect(await screen.findByRole("button", { name: /general/i })).toBeInTheDocument();
197-
expect(document.querySelector(".settings-mobile-root-hero")).toBeTruthy();
198-
expect(document.querySelector(".settings-mobile-list")).toBeTruthy();
197+
expect(document.querySelector(".settings-mobile-root")).toBeTruthy();
198+
expect(document.querySelector(".settings-mobile-group")).toBeTruthy();
199+
expect(document.querySelector(".settings-mobile-group__list")).toBeTruthy();
200+
expect(document.querySelector(".settings-mobile-root-hero")).toBeNull();
199201
});
200202

201203
it("renders the app loading shell scene without bootstrapping routes", async () => {

packages/web/src/ui-preview/scene-metadata.test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,10 @@ describe("ui preview scene metadata", () => {
5656
expect(scene?.devices).toEqual(["desktop"]);
5757
expect(scene?.themes.every((theme) => theme.endsWith("-light"))).toBe(true);
5858
});
59+
60+
it("captures the mobile settings homepage from the grouped root container", () => {
61+
const scene = UI_PREVIEW_SCENE_METADATA.find((entry) => entry.id === "settings-mobile-root");
62+
63+
expect(scene?.capture?.selector).toBe(".settings-mobile-root");
64+
});
5965
});

packages/web/src/ui-preview/scene-metadata.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ export const UI_PREVIEW_SCENE_METADATA: UiPreviewSceneMetadata[] = [
103103
devices: ["mobile"],
104104
themes: allThemeIds(),
105105
locales: ["zh", "en"],
106-
capture: { selector: ".settings-mobile-list" },
106+
capture: { selector: ".settings-mobile-root" },
107107
},
108108
{
109109
id: "app-loading-shell",

0 commit comments

Comments
 (0)