From e7210c71bf34cc3df34dac19a940ed479c516371 Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Sun, 8 Nov 2026 10:47:30 +0900 Subject: [PATCH] =?UTF-8?q?test(e2e):=20=EC=98=88=EC=A0=9C=20=ED=99=94?= =?UTF-8?q?=EB=A9=B4=20=EB=8C=80=EC=8B=A0=20=ED=94=8C=EB=9E=AB=ED=8F=BC=20?= =?UTF-8?q?=EB=9D=BC=EC=9A=B0=ED=8A=B8=EC=97=90=EC=84=9C=20=EC=85=B8=20?= =?UTF-8?q?=EB=8F=99=EC=9E=91=EC=9D=84=20=ED=99=95=EC=9D=B8=ED=95=9C?= =?UTF-8?q?=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 셸 동작을 보는 e2e(반응형, 스크롤 복원, 해시 링크, 타이포그래피, 건너뛰기 링크, 메뉴 이동, 운영 CSP, compact, en-US의 lang)가 지울 예제 화면을 열거나 그 메뉴를 누른다. 홈과 /examples/platform으로 옮겼다. 스크롤 복원은 계약 표가 그려진 뒤 스크롤하고, 해시 링크는 비동기 표보다 위에 있는 첫 절을 대상으로 한다. WebKit은 scroll anchoring이 없어 표 아래 대상이 1px 밀렸다. 갤러리 자체의 320px 리플로는 앞 커밋의 workshop 시험이 맡는다. 위험: 홈과 플랫폼 개요의 모양이 바뀌면 이 시험들의 대상도 바뀐다. 검증(desktop): 샘플을 지운 최종 트리에서 test:e2e 183 passed. --- tests/e2e/accessibility.spec.ts | 2 +- tests/e2e/app-shell.spec.ts | 12 ++++++------ tests/e2e/compact-smoke.spec.ts | 4 ++-- tests/e2e/i18n.spec.ts | 15 ++++++--------- tests/e2e/production-csp.spec.ts | 4 ++-- tests/e2e/responsive.spec.ts | 12 +++++++----- tests/e2e/scroll-restoration.spec.ts | 19 ++++++++++++------- tests/e2e/typography.spec.ts | 3 ++- 8 files changed, 38 insertions(+), 33 deletions(-) diff --git a/tests/e2e/accessibility.spec.ts b/tests/e2e/accessibility.spec.ts index 36816e53..1c631214 100644 --- a/tests/e2e/accessibility.spec.ts +++ b/tests/e2e/accessibility.spec.ts @@ -110,7 +110,7 @@ test("@a11y keyboard reaches the primary route action with visible focus", async // 08-09. axe's skip-link rule is best-practice, outside WCAG_TAGS, so the only // way past the header and sidebar (WCAG 2.4.1) needs its own check. test("@a11y skip link moves keyboard focus into main", async ({ page }) => { - await page.goto("/examples/ui"); + await page.goto("/examples/platform"); await expect(page.getByRole("heading", { level: 1 })).toBeFocused(); const skipLink = page.getByRole("link", { name: "본문으로 건너뛰기" }); await skipLink.focus(); diff --git a/tests/e2e/app-shell.spec.ts b/tests/e2e/app-shell.spec.ts index 61a1ad8a..b9d15e8e 100644 --- a/tests/e2e/app-shell.spec.ts +++ b/tests/e2e/app-shell.spec.ts @@ -15,12 +15,12 @@ test("navigates to a registry-backed example without a page reload", async ({ await page.goto("/"); await page .getByRole("navigation", { name: "주요 탐색" }) - .getByRole("link", { name: "화면 상태" }) + .getByRole("link", { name: "플랫폼 구성" }) .click(); - await expect(page).toHaveURL(/\/examples\/states$/); + await expect(page).toHaveURL(/\/examples\/platform$/); await expect( - page.getByRole("heading", { level: 1, name: "화면 상태" }), + page.getByRole("heading", { level: 1, name: "플랫폼 구성" }), ).toBeFocused(); }); @@ -55,11 +55,11 @@ test("moves focus to the new page after a mobile drawer link, not back to the me const navigation = page.getByRole("navigation", { name: "주요 탐색" }); await menu.click(); - await navigation.getByRole("link", { name: "화면 상태" }).click(); + await navigation.getByRole("link", { name: "플랫폼 구성" }).click(); - await expect(page).toHaveURL(/\/examples\/states$/); + await expect(page).toHaveURL(/\/examples\/platform$/); await expect(menu).toHaveAttribute("aria-expanded", "false"); - const heading = page.getByRole("heading", { level: 1, name: "화면 상태" }); + const heading = page.getByRole("heading", { level: 1, name: "플랫폼 구성" }); await expect(heading).toBeFocused(); // Give any late restore (dialog close timer, lazy route commit) time to run. await page.waitForTimeout(300); diff --git a/tests/e2e/compact-smoke.spec.ts b/tests/e2e/compact-smoke.spec.ts index d084c229..e051ff5f 100644 --- a/tests/e2e/compact-smoke.spec.ts +++ b/tests/e2e/compact-smoke.spec.ts @@ -21,9 +21,9 @@ test("boots and navigates the compact production shell", async ({ page }) => { // accessibility tree while it is open. Scope to the navigation and match the // whole name, or a route call to action on the page behind it also matches. await navigation - .getByRole("link", { name: "UI 구성요소", exact: true }) + .getByRole("link", { name: "플랫폼 구성", exact: true }) .click(); - await expect(page).toHaveURL(/\/examples\/ui$/); + await expect(page).toHaveURL(/\/examples\/platform$/); await expect(page.locator("html")).toHaveAttribute("data-build-id", EXPECTED_BUILD_ID); const overflow = await page.evaluate( () => document.documentElement.scrollWidth - window.innerWidth, diff --git a/tests/e2e/i18n.spec.ts b/tests/e2e/i18n.spec.ts index 1b663f5c..168bdc33 100644 --- a/tests/e2e/i18n.spec.ts +++ b/tests/e2e/i18n.spec.ts @@ -54,10 +54,12 @@ test("keeps the header selectors as wide as their options in every locale", asyn } }); -// 08-07. The example screens stay outside the catalog on purpose, so their +// 08-07. The platform overview stays outside the catalog on purpose, so its // copy is Korean in every locale. Under en-US a screen reader would read that -// copy with English rules unless the screen names its own language. -test("marks the Korean-only example screens as Korean under another locale", async ({ +// copy with English rules unless the screen names its own language. (The +// example screens that shared this rule were deleted on 2026-11-07; the +// galleries are workshop stories.) +test("marks the Korean-only platform overview as Korean under another locale", async ({ page, }) => { await page.setViewportSize({ width: 1280, height: 800 }); @@ -66,12 +68,7 @@ test("marks the Korean-only example screens as Korean under another locale", asy await expect(page.locator("html")).toHaveAttribute("lang", "en-US"); const navigation = page.getByRole("navigation", { name: "Primary navigation" }); - for (const label of [ - "Platform composition", - "UI components", - "Screen states", - "Authentication", - ]) { + for (const label of ["Platform composition"]) { await navigation.getByRole("link", { name: label }).click(); await expect(page).toHaveTitle(new RegExp(`^${label} `)); await expect(page.locator("main .ui-page").first(), label).toHaveAttribute( diff --git a/tests/e2e/production-csp.spec.ts b/tests/e2e/production-csp.spec.ts index c4065fd6..19b180e3 100644 --- a/tests/e2e/production-csp.spec.ts +++ b/tests/e2e/production-csp.spec.ts @@ -63,10 +63,10 @@ test("boots and changes route under the production security headers", async ({ p await page .getByRole("navigation", { name: "주요 탐색" }) - .getByRole("link", { name: "화면 상태" }) + .getByRole("link", { name: "플랫폼 구성" }) .click(); await expect( - page.getByRole("heading", { level: 1, name: "화면 상태" }), + page.getByRole("heading", { level: 1, name: "플랫폼 구성" }), ).toBeFocused(); expect(await cspViolations(page)).toEqual([]); diff --git a/tests/e2e/responsive.spec.ts b/tests/e2e/responsive.spec.ts index 574fadab..215322f4 100644 --- a/tests/e2e/responsive.spec.ts +++ b/tests/e2e/responsive.spec.ts @@ -1,12 +1,14 @@ import { expect, test } from "../support/browser/strict-browser-test.ts"; -test("reflows the UI gallery at the 320px minimum without horizontal overflow", async ({ +// The gallery's own 320px reflow is a workshop check +// (tests/storybook/galleries.spec.ts); this one is the shell around a page. +test("reflows the shell at the 320px minimum without horizontal overflow", async ({ page, }) => { await page.setViewportSize({ width: 320, height: 720 }); - await page.goto("/examples/ui"); + await page.goto("/"); await expect( - page.getByRole("heading", { level: 1, name: "UI 구성요소" }), + page.getByRole("heading", { level: 1, name: "Clean Architecture Frontend" }), ).toBeVisible(); await expect( page.getByRole("button", { name: "메뉴", exact: true }), @@ -55,11 +57,11 @@ for (const width of [320, 375, 640]) { }); } -test("keeps desktop navigation and two-column examples at wide viewports", async ({ +test("keeps desktop navigation and two-column sections at wide viewports", async ({ page, }) => { await page.setViewportSize({ width: 1440, height: 900 }); - await page.goto("/examples/ui"); + await page.goto("/examples/platform"); await expect(page.getByRole("navigation", { name: "주요 탐색" })).toBeVisible(); await expect( diff --git a/tests/e2e/scroll-restoration.spec.ts b/tests/e2e/scroll-restoration.spec.ts index f4f99d81..4ba4412d 100644 --- a/tests/e2e/scroll-restoration.spec.ts +++ b/tests/e2e/scroll-restoration.spec.ts @@ -3,30 +3,35 @@ import { expect, test, type Page } from "../support/browser/strict-browser-test. const scrollY = (page: Page) => page.evaluate(() => Math.round(window.scrollY)); // 08-08. Back restores where the user was; a new route starts at the top. +// The platform overview is the template's long page; its contract tables +// fill in after the title, so the test waits for them before it scrolls. test("restores the scroll position when navigating back", async ({ page }) => { const heading = page.getByRole("heading", { level: 1 }); - await page.goto("/examples/ui"); - await expect(heading).toHaveText("UI 구성요소"); + await page.goto("/examples/platform"); + await expect(heading).toHaveText("플랫폼 구성"); + await expect(page.locator("main [aria-busy='true']")).toHaveCount(0); await page.evaluate(() => window.scrollTo(0, 900)); await expect.poll(() => scrollY(page)).toBe(900); await page .getByRole("navigation", { name: "주요 탐색" }) - .getByRole("link", { name: "화면 상태" }) + .getByRole("link", { name: "홈" }) .click(); - await expect(heading).toHaveText("화면 상태"); + await expect(heading).toHaveText("Clean Architecture Frontend"); await expect.poll(() => scrollY(page)).toBe(0); await page.goBack(); - await expect(heading).toHaveText("UI 구성요소"); + await expect(heading).toHaveText("플랫폼 구성"); await expect.poll(() => scrollY(page)).toBe(900); }); +// The first section: the contract tables below it fill in after the page +// draws, and WebKit, which has no scroll anchoring, moves a target below them. test("opens a hash link at its target below the sticky header", async ({ page, }) => { - await page.goto("/examples/ui#tokens-title"); - const target = page.locator("#tokens-title"); + await page.goto("/examples/platform#platform-release-title"); + const target = page.locator("#platform-release-title"); await expect(target).toBeInViewport(); const top = await target.evaluate((element) => Math.round(element.getBoundingClientRect().top), diff --git a/tests/e2e/typography.spec.ts b/tests/e2e/typography.spec.ts index fa707b6a..0fc547e0 100644 --- a/tests/e2e/typography.spec.ts +++ b/tests/e2e/typography.spec.ts @@ -6,7 +6,8 @@ import { expect, test } from "../support/browser/strict-browser-test.ts"; test("steps heading size and weight down from h2 to body copy", async ({ page, }) => { - await page.goto("/examples/states"); + // Section titles (h2) and card titles (h3) on the platform overview. + await page.goto("/examples/platform"); await expect(page.getByRole("heading", { level: 1 })).toBeVisible(); const scale = await page.evaluate(() => {