From b9a8a1a6c23b662d6765fad4b4461e6a5e0cd2e5 Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Sun, 1 Nov 2026 23:12:30 +0900 Subject: [PATCH] =?UTF-8?q?test(presentation):=20=EA=B1=B4=EB=84=88?= =?UTF-8?q?=EB=9B=B0=EA=B8=B0=20=EB=A7=81=ED=81=AC=C2=B7=EB=A1=9C=EB=94=A9?= =?UTF-8?q?=20=EB=B0=9C=ED=91=9C=C2=B7=EC=82=AC=EC=9D=B4=EB=93=9C=EB=B0=94?= =?UTF-8?q?=20=EC=9D=B4=EB=A6=84=EC=9D=84=20=ED=85=8C=EC=8A=A4=ED=8A=B8?= =?UTF-8?q?=EB=A1=9C=20=EC=A7=80=ED=82=A8=EB=8B=A4=20(08-09)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 문제: 접근성 기본 장치 일부를 지키는 테스트가 없었다. 리뷰 변이 중 M3(건너뛰기 링크 대상을 #content로), M4(LoadingSurface의 aria-live 제거), M5(상태 화면 제목을

로), M6(사이드바 aria-label 제거)가 component 211개를 모두 통과했다. e2e의 axe는 WCAG 태그만 돌려 best-practice인 skip-link 규칙이 빠지고, 건너뛰기 링크를 누르는 e2e도 없었다. 고른 방법: 리뷰의 최소 개선 방향 그대로 단언을 더했다. - app-shell.test.tsx: 건너뛰기 링크 href가 main의 id와 같고, 이름 있는 complementary 안에 주요 탐색이 있다. - async-surface.test.tsx: LoadingSurface가 aria-busy와 aria-live="polite"를 가진다. - accessibility.spec.ts: 건너뛰기 링크 Enter 뒤 포커스가 main 안에 있다. - M5는 08-05 커밋의 제목 수준 테스트가 이미 잡는다. 버린 대안: axe에 best-practice 태그를 켜기 — 이번 범위 밖의 위반까지 한꺼번에 게이트가 된다. 위험·한계: 사이드바 이름 "사이드바"는 위치를 말하는 이름이라 리뷰가 관찰로 남겼다. 테스트는 지금 이름을 고정하므로 이름을 바꾸면 테스트도 같이 바꾼다. M3 변이 빌드에서 e2e는 공용 실행 잠금이 길게 잡혀 돌리지 못했다(component 테스트가 M3를 잡는다). 검증(테스트만 추가라 RED는 변이로 확인): - M3: app-shell landmarks 테스트 실패(1 failed | 221 passed) - M4: loading surface 테스트 실패(1 failed | 221 passed) - M5(state-surfaces.tsx 제목을

로): 08-05 테스트 2건 실패 - M6: app-shell landmarks 테스트 실패(1 failed | 221 passed) - 변이 없음: tests/component 222/222, 새 e2e chromium·firefox·webkit 3/3. tsc test 통과, eslint 통과. Refs: docs/reviews/2026-11-01-maturity-review/08-presentation.md 08-09 --- tests/component/app-shell.test.tsx | 16 ++++++++++++++++ tests/component/async-surface.test.tsx | 9 +++++++++ tests/e2e/accessibility.spec.ts | 20 ++++++++++++++++++++ 3 files changed, 45 insertions(+) diff --git a/tests/component/app-shell.test.tsx b/tests/component/app-shell.test.tsx index da23dd48..b43a61d3 100644 --- a/tests/component/app-shell.test.tsx +++ b/tests/component/app-shell.test.tsx @@ -114,3 +114,19 @@ describe("app shell mobile navigation drawer", () => { await waitFor(() => expect(menuButton).toHaveFocus()); }); }); + +describe("app shell landmarks (08-09)", () => { + it("points the skip link at the main region and names the sidebar", async () => { + renderShell(); + + const main = await screen.findByRole("main"); + expect(main.id).not.toBe(""); + expect( + screen.getByRole("link", { name: "본문으로 건너뛰기" }), + ).toHaveAttribute("href", `#${main.id}`); + const sidebar = screen.getByRole("complementary", { name: "사이드바" }); + expect( + within(sidebar).getByRole("navigation", { name: "주요 탐색" }), + ).toBeVisible(); + }); +}); diff --git a/tests/component/async-surface.test.tsx b/tests/component/async-surface.test.tsx index 17cf151c..3be76c70 100644 --- a/tests/component/async-surface.test.tsx +++ b/tests/component/async-surface.test.tsx @@ -11,6 +11,7 @@ import { AccessSurface, EmptySurface, ErrorSummary, + LoadingSurface, TerminalErrorSurface, } from "../../src/presentation/design-system/index.ts"; import StateGalleryPage from "../../src/presentation/examples/state-gallery-page.tsx"; @@ -210,6 +211,14 @@ describe("async UI state matrix", () => { expect(action).toHaveBeenCalledOnce(); }); + it("announces a loading surface politely while it is busy (08-09)", () => { + render(); + + const surface = screen.getByRole("region", { name: "목록을 불러오는 중" }); + expect(surface).toHaveAttribute("aria-busy", "true"); + expect(surface).toHaveAttribute("aria-live", "polite"); + }); + it("renders an idle query as neither loading nor empty", () => { const { container, rerender } = render( content, diff --git a/tests/e2e/accessibility.spec.ts b/tests/e2e/accessibility.spec.ts index f2aca7e9..23c00bdc 100644 --- a/tests/e2e/accessibility.spec.ts +++ b/tests/e2e/accessibility.spec.ts @@ -61,6 +61,26 @@ test("@a11y keyboard reaches the primary route action with visible focus", async await expect(action).toHaveCSS("outline-style", "solid"); }); +// 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 expect(page.getByRole("heading", { level: 1 })).toBeFocused(); + const skipLink = page.getByRole("link", { name: "본문으로 건너뛰기" }); + await skipLink.focus(); + await expect(skipLink).toBeFocused(); + + await page.keyboard.press("Enter"); + + await expect + .poll(() => + page.evaluate( + () => document.querySelector("main")?.contains(document.activeElement) ?? false, + ), + ) + .toBe(true); +}); + test("@a11y reduced-motion policy disables long animation", async ({ page }) => { await page.emulateMedia({ reducedMotion: "reduce" }); await page.goto("/");