From 0665cd764f30faea2f394fedf2167fe8104644e6 Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Thu, 12 Nov 2026 15:03:16 +0900 Subject: [PATCH 1/9] =?UTF-8?q?test(browser):=20Firefox=EC=9D=98=20Pretend?= =?UTF-8?q?ard=20name=20=ED=91=9C=20=EA=B2=BD=EA=B3=A0=20=ED=95=9C=20?= =?UTF-8?q?=EC=A4=84=EB=A7=8C=20=EB=B0=9B=EC=95=84=EB=93=A4=EC=9D=B8?= =?UTF-8?q?=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Firefox는 번들된 pretendard 1.3.9 가변 폰트를 열 때마다 콘솔에 「downloadable font: name: name records are not sorted」 경고를 낸다. 브라우저 시험의 공용 fixture(strict-browser-test.ts)는 경고도 실패로 세므로, Firefox에서는 폰트를 쓰는 거의 모든 시험이 떨어진다. 2026-11-12 main(7853ff1d) 기준으로 FE-GATE-008 e2e의 Firefox 실패 143건 중 118건, capability 19건 전부, FE-GATE-009의 29건이 이것 하나뿐이었다. 경고는 폰트 파일 안 name 레코드의 순서를 말한다. Firefox의 폰트 검사기 (OTS)가 순서를 고치고 폰트를 그대로 쓴다. Chromium과 WebKit은 아무것도 내지 않는다. 그래서 이 경고 한 줄만 fixture에서 무시한다. 폰트 이름, 가중치 범위, 파일 이름까지 맞는 문장만 받는다. 폰트가 거부되면 「rejected by sanitizer」 같은 다른 문장이 나오고, 그것은 여전히 실패다. 버린 대안: 폰트를 다시 써서(fonttools로 저장) 정렬된 파일을 repo에 두기. npm 패키지 대신 고친 바이너리를 직접 관리하게 되고, 패키지를 올릴 때마다 다시 만들어야 한다. 위험: Pretendard를 다른 판으로 바꿔 경고 문장이 달라지면 이 정규식이 맞지 않아 다시 실패한다. 그때는 그 문장을 보고 판단한다. 검증 (desktop, Playwright 1.62, CI env): - Firefox에서 빌드한 앱: Pretendard Variable status "loaded", document.fonts.check('16px "Pretendard Variable"') true, h1 글꼴 Pretendard Variable. 경고는 그대로 한 줄 나온다. - test:browser-capabilities: Firefox 실패 19건 → 0건. --- tests/support/browser/strict-browser-test.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tests/support/browser/strict-browser-test.ts b/tests/support/browser/strict-browser-test.ts index e84891d..edde745 100644 --- a/tests/support/browser/strict-browser-test.ts +++ b/tests/support/browser/strict-browser-test.ts @@ -5,10 +5,22 @@ import { type Page, } from "@playwright/test"; +/** + * Firefox's font sanitizer (OTS) reports that the `name` table of the bundled + * `pretendard` 1.3.9 variable font lists its records out of order. It sorts + * them itself and the font still loads (`document.fonts.check` is true in + * Firefox); Chromium and WebKit say nothing. The file is the npm package's, not + * ours. Only this exact warning for this font is ignored: a font the sanitizer + * rejects logs a different line and still fails. + */ +const FIREFOX_PRETENDARD_NAME_ORDER = + /^\[JavaScript Warning: "downloadable font: name: name records are not sorted\. \(font-family: "Pretendard Variable" style:normal weight:45\.\.920 stretch:100 src index:0\) source: http:\/\/127\.0\.0\.1:\d+\/[\w./@-]*PretendardVariable(?:-[\w-]+)?\.woff2"\]$/u; + function ignoredConsole(message: ConsoleMessage) { return ( message.type() === "warning" && - message.text().includes("NO_COLOR") + (message.text().includes("NO_COLOR") || + FIREFOX_PRETENDARD_NAME_ORDER.test(message.text())) ); } From cd4fa8ce29843e32b89dac3e2069960b83ee5bb7 Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Thu, 12 Nov 2026 15:03:16 +0900 Subject: [PATCH 2/9] =?UTF-8?q?fix(a11y):=20=EC=A7=88=EB=AC=B8=EC=9D=98=20?= =?UTF-8?q?=E3=80=8C=EB=8B=A4=EC=9D=8C=20=EA=B2=80=EC=A6=9D=E3=80=8D=20?= =?UTF-8?q?=EB=9D=BC=EB=B2=A8=EC=9D=84=20WCAG=20AA=20=EB=8C=80=EB=B9=84?= =?UTF-8?q?=EB=A1=9C=20=EC=98=AC=EB=A6=B0=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Question 화면의 「다음 검증」 상자 안 라벨(「왜 다음인가」 등)은 --faint(#6c6f76)를 info 바탕(#eef1fc) 위에 쓴다. 대비가 4.46:1이라 WCAG AA 4.5:1에 못 미친다. axe가 세 엔진 모두에서 color-contrast serious로 잡아 FE-GATE-009(TECH_LOG_QUESTION)가 떨어진다. 이 두 라벨만 --muted(#5a5d64)로 바꾼다. 같은 바탕에서 5.85:1이다. --faint 토큰 자체는 흰 바탕에서 5.03:1이라 다른 곳은 문제가 없어서 건드리지 않는다. 위험: 라벨 글자가 조금 진해진다. visual 기준 이미지 가운데 Question 화면이 바뀐다. visual 기준 이미지는 이 변경과 상관없이 8월 18일 것이라 전부 다시 검토해야 한다(PR 본문). 검증: test:a11y에서 TECH_LOG_QUESTION이 chromium·firefox·webkit 모두 통과한다(고치기 전 세 엔진 모두 color-contrast 실패). --- src/features/tech-log/presentation/styles/globals.css | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/features/tech-log/presentation/styles/globals.css b/src/features/tech-log/presentation/styles/globals.css index efaeadf..338dbe4 100644 --- a/src/features/tech-log/presentation/styles/globals.css +++ b/src/features/tech-log/presentation/styles/globals.css @@ -3443,10 +3443,12 @@ summary { margin-top: 22px; } +/* The box is the info surface (#eef1fc), where `--faint` is 4.46:1 and misses + WCAG AA; `--muted` is 5.85:1 there. */ .next-validation-why > p, .next-validation-how > p { margin: 0 0 8px; - color: var(--faint); + color: var(--muted); font-size: 12px; font-weight: 650; letter-spacing: 0.06em; From 500dbc6217f865232bcadf7962c94a6ae4bd0664 Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Thu, 12 Nov 2026 15:03:16 +0900 Subject: [PATCH 3/9] =?UTF-8?q?test(e2e):=20Studio=20=ED=99=94=EB=A9=B4=20?= =?UTF-8?q?=EC=8B=9C=ED=97=98=EC=9D=80=20=EB=8D=B0=EB=AA=A8=20=EC=84=B8?= =?UTF-8?q?=EC=85=98=EC=9C=BC=EB=A1=9C=20=EB=A1=9C=EA=B7=B8=EC=9D=B8?= =?UTF-8?q?=ED=95=9C=20=EB=92=A4=20=EB=B3=B8=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 5e2b1a5(08-20)부터 로그인하지 않은 방문자는 Studio 경로에서 로그인 화면만 받는다. e2e 빌드는 local profile(AUTH_MODE demo)이고, 데모 세션은 로그아웃 상태로 시작해 메모리에만 있다. 그런데 Studio 시험은 로그인하지 않고 들어간다. 그래서 - 편집기·접근성 시험은 로그인 화면에서 「저장」 버튼이나 「요약」 칸을 기다리다 떨어지고, - 경로별 axe 검사(accessibility.spec)와 visual 시험은 Studio 경로 12개에서 Studio 화면 대신 로그인 화면을 검사하고 있었다. tech-log-fixtures.ts에 gotoTechLogStudio를 둔다. gotoTechLog 뒤에 작성자가 쓰는 「로그인 시작」 버튼을 누르고, 로그인한 세션만 받는 Studio 머리말이 뜰 때까지 기다린다. Studio 경로를 여는 e2e·접근성·visual 시험이 이것을 쓴다. 버린 대안: 앱의 세션을 시험에서 직접 authenticated로 바꾸기. 로그인 버튼과 관문 동작을 건너뛰게 되고, 앱 내부에 시험용 구멍이 필요하다. 위험: 이 변경으로 Studio 화면을 실제로 검사하게 되면서, 로그인 화면에 가려져 있던 결함이 드러난다. MOCK Studio에서도 관리 기능(주제·프로젝트· 릴리즈)이 실제 HTTP(/api/v1/studio/session)로 나가 연결이 거부된다 (create-tech-log-feature-input.ts의 createManagementGateway에 MOCK 분기가 없다). 그 결함은 이 PR 밖이다. 그동안 Studio 편집기·대시보드 시험은 그 이유로 실패한다. 검증: Studio 경로에서 로그인 뒤 Studio 머리말과 주 탐색이 뜨는 것을 error-context 스냅숏으로 확인했다. 남은 실패는 모두 위 HTTP 요청이다. --- tests/e2e/accessibility.spec.ts | 7 ++++++- tests/e2e/tech-log-accessibility.spec.ts | 11 +++++++---- tests/e2e/tech-log-responsive.spec.ts | 3 ++- tests/support/browser/tech-log-fixtures.ts | 21 +++++++++++++++++++++ tests/visual/tech-log.visual.spec.ts | 20 ++++++++++++-------- 5 files changed, 48 insertions(+), 14 deletions(-) diff --git a/tests/e2e/accessibility.spec.ts b/tests/e2e/accessibility.spec.ts index ebf8b80..dd7b1c1 100644 --- a/tests/e2e/accessibility.spec.ts +++ b/tests/e2e/accessibility.spec.ts @@ -3,6 +3,7 @@ import AxeBuilder from "@axe-core/playwright"; import { expect, test } from "../support/browser/strict-browser-test.ts"; import { gotoTechLog, + gotoTechLogStudio, TECH_LOG_CANONICAL_ROUTES, } from "../support/browser/tech-log-fixtures.ts"; @@ -12,7 +13,11 @@ for (const route of TECH_LOG_CANONICAL_ROUTES.filter( test(`@a11y ${route.routeId} has no critical or serious Axe violations`, async ({ page, }) => { - await gotoTechLog(page, route.path); + // A Studio route checks the screen a writer gets, not the sign-in surface. + await (route.layout === "STUDIO" ? gotoTechLogStudio : gotoTechLog)( + page, + route.path, + ); const results = await new AxeBuilder({ page }) .withTags(["wcag2a", "wcag2aa", "wcag21a", "wcag21aa"]) .analyze(); diff --git a/tests/e2e/tech-log-accessibility.spec.ts b/tests/e2e/tech-log-accessibility.spec.ts index 49531af..67d7487 100644 --- a/tests/e2e/tech-log-accessibility.spec.ts +++ b/tests/e2e/tech-log-accessibility.spec.ts @@ -1,7 +1,10 @@ import AxeBuilder from "@axe-core/playwright"; import { expect, test } from "../support/browser/strict-browser-test.ts"; -import { gotoTechLog } from "../support/browser/tech-log-fixtures.ts"; +import { + gotoTechLog, + gotoTechLogStudio, +} from "../support/browser/tech-log-fixtures.ts"; function blockingViolations(results: Awaited>) { return results.violations.filter((violation) => @@ -26,7 +29,7 @@ test("Studio mobile navigation is keyboard reachable and exposes its expanded st page, }) => { await page.setViewportSize({ width: 390, height: 844 }); - await gotoTechLog(page, "/studio"); + await gotoTechLogStudio(page, "/studio"); const trigger = page.locator(".studio-menu-trigger"); await trigger.focus(); await page.keyboard.press("Enter"); @@ -37,7 +40,7 @@ test("Studio mobile navigation is keyboard reachable and exposes its expanded st test("dirty-leave dialog is labelled, traps focus, and restores the invoking link", async ({ page, }) => { - await gotoTechLog( + await gotoTechLogStudio( page, "/studio/documents/11111111-1111-4111-8111-111111111111/edit", ); @@ -63,7 +66,7 @@ test("open Public search and Studio leave dialogs have no blocking Axe findings" .analyze(); expect(blockingViolations(results)).toEqual([]); - await gotoTechLog( + await gotoTechLogStudio( page, "/studio/documents/11111111-1111-4111-8111-111111111111/edit", ); diff --git a/tests/e2e/tech-log-responsive.spec.ts b/tests/e2e/tech-log-responsive.spec.ts index 9b79728..1e89ff4 100644 --- a/tests/e2e/tech-log-responsive.spec.ts +++ b/tests/e2e/tech-log-responsive.spec.ts @@ -1,6 +1,7 @@ import { expect, test } from "../support/browser/strict-browser-test.ts"; import { gotoTechLog, + gotoTechLogStudio, horizontalOverflow, TECH_LOG_BREAKPOINT_WIDTHS, } from "../support/browser/tech-log-fixtures.ts"; @@ -29,7 +30,7 @@ for (const width of [1050, 1024, 980, 900, 820, 768, 767, 420, 390, 375] as cons page, }) => { await page.setViewportSize({ width, height: 1000 }); - await gotoTechLog( + await gotoTechLogStudio( page, "/studio/documents/11111111-1111-4111-8111-111111111111/edit", ); diff --git a/tests/support/browser/tech-log-fixtures.ts b/tests/support/browser/tech-log-fixtures.ts index 4deab5d..407de7f 100644 --- a/tests/support/browser/tech-log-fixtures.ts +++ b/tests/support/browser/tech-log-fixtures.ts @@ -138,6 +138,27 @@ export async function gotoTechLog(page: Page, path: string) { await settleTechLogPage(page); } +/** + * 5e2b1a5 (08-20). A signed-out visitor gets only the sign-in surface on a + * Studio route. The e2e build is the local profile (`AUTH_MODE: "demo"`), whose + * session starts signed out and lives in memory, so every page load starts + * signed out again. This signs in with the button a writer uses and waits for + * the Studio chrome that only a signed-in session gets. + */ +export async function signInToStudio(page: Page) { + const gate = page.locator('[data-surface="authentication-required"]'); + await gate.getByRole("button", { name: "로그인 시작" }).click(); + await page.locator("header.studio-header").waitFor(); + await gate.waitFor({ state: "detached" }); + await page.waitForLoadState("networkidle"); +} + +/** `gotoTechLog` for a Studio route, signed in. */ +export async function gotoTechLogStudio(page: Page, path: string) { + await gotoTechLog(page, path); + await signInToStudio(page); +} + export async function horizontalOverflow(page: Page) { return page.evaluate(() => ({ clientWidth: document.documentElement.clientWidth, diff --git a/tests/visual/tech-log.visual.spec.ts b/tests/visual/tech-log.visual.spec.ts index 5c69d23..4d3a227 100644 --- a/tests/visual/tech-log.visual.spec.ts +++ b/tests/visual/tech-log.visual.spec.ts @@ -1,6 +1,7 @@ import { expect, test } from "../support/browser/strict-browser-test.ts"; import { gotoTechLog, + gotoTechLogStudio, TECH_LOG_BREAKPOINT_WIDTHS, TECH_LOG_CANONICAL_ROUTES, TECH_LOG_PUBLIC_FIXTURE_PATHS, @@ -16,7 +17,10 @@ for (const route of TECH_LOG_CANONICAL_ROUTES) { for (const width of [360, 1440] as const) { test(`${route.routeId} matches the reviewed ${width}px visual`, async ({ page }) => { await page.setViewportSize({ width, height: 1000 }); - await gotoTechLog(page, route.path); + await (route.layout === "STUDIO" ? gotoTechLogStudio : gotoTechLog)( + page, + route.path, + ); await expect(page).toHaveScreenshot(`${route.routeId.toLowerCase()}-${width}.png`, { fullPage: true, }); @@ -49,7 +53,7 @@ for (const width of TECH_LOG_BREAKPOINT_WIDTHS) { for (const [state, path] of TECH_LOG_STUDIO_STATE_PATHS) { test(`Studio ${state} matches its reviewed wide state visual`, async ({ page }) => { await page.setViewportSize({ width: 1440, height: 1000 }); - await gotoTechLog(page, path); + await gotoTechLogStudio(page, path); await expect(page).toHaveScreenshot(`tech-log-studio-${state}-1440.png`, { fullPage: true, }); @@ -82,7 +86,7 @@ test("open Public search dialog matches the source without a mask", async ({ pag test("open Studio mobile menu matches the source without a mask", async ({ page }) => { await page.setViewportSize({ width: 390, height: 844 }); - await gotoTechLog(page, "/studio"); + await gotoTechLogStudio(page, "/studio"); await page.getByRole("button", { name: "Studio 메뉴 열기" }).click(); await expect(page).toHaveScreenshot("tech-log-studio-mobile-menu-390.png", { fullPage: true, @@ -91,7 +95,7 @@ test("open Studio mobile menu matches the source without a mask", async ({ page test("Studio immediate preview matches the source without a mask", async ({ page }) => { await page.setViewportSize({ width: 1440, height: 1000 }); - await gotoTechLog( + await gotoTechLogStudio( page, "/studio/documents/11111111-1111-4111-8111-111111111111/edit", ); @@ -103,7 +107,7 @@ test("Studio immediate preview matches the source without a mask", async ({ page test("Studio dirty-leave dialog matches the source without a mask", async ({ page }) => { await page.setViewportSize({ width: 1440, height: 1000 }); - await gotoTechLog( + await gotoTechLogStudio( page, "/studio/documents/11111111-1111-4111-8111-111111111111/edit", ); @@ -119,7 +123,7 @@ test("Studio dirty-leave dialog matches the source without a mask", async ({ pag test("Studio newly-created current preview matches the source without a mask", async ({ page }) => { await page.setViewportSize({ width: 1440, height: 1000 }); - await gotoTechLog( + await gotoTechLogStudio( page, "/studio/documents/11111111-1111-4111-8111-111111111113/preview", ); @@ -132,7 +136,7 @@ test("Studio newly-created current preview matches the source without a mask", a test("Studio unpublish confirmation matches the source without a mask", async ({ page }) => { await page.setViewportSize({ width: 1440, height: 1000 }); - await gotoTechLog(page, "/studio/publications"); + await gotoTechLogStudio(page, "/studio/publications"); await page .getByRole("button", { name: /컬렉션 Fetch Join과 페이징은 왜 충돌하는가 게시 취소/, @@ -148,7 +152,7 @@ test("Studio warning acknowledgement publish state matches the source without a page, }) => { await page.setViewportSize({ width: 1440, height: 1000 }); - await gotoTechLog( + await gotoTechLogStudio( page, "/studio/documents/11111111-1111-4111-8111-111111111116/validation", ); From db69e5203b5d2cfcfc49612ed22688f66a76a4f5 Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Thu, 12 Nov 2026 15:03:16 +0900 Subject: [PATCH 4/9] =?UTF-8?q?test(e2e):=20Studio=20=EC=9E=91=EC=97=85=20?= =?UTF-8?q?=ED=9D=90=EB=A6=84=20=EC=8B=9C=ED=97=98=EC=9D=84=20fixture=20?= =?UTF-8?q?=EC=8B=9C=EA=B3=84=EB=A1=9C=20=EB=8F=8C=EB=A6=B0=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit tech-log-studio-workflow.spec.ts만 page.goto로 들어가 실제 시계를 쓴다. mock 저장본의 검증 결과는 2026-08-14 09:40~10:10 KST에만 유효해서, 실제 시각에서는 「지난 결과 · 저장 후 다시 검증해야 합니다」가 나오고 「현재 저장 버전의 검증을 통과했습니다」를 찾지 못해 떨어진다. 로그인도 하지 않았다. 다른 Studio 시험처럼 gotoTechLogStudio(fixture 시계 2026-08-14T01:00Z, reduced motion, 데모 로그인)로 들어간다. 검증: 두 시험이 chromium·firefox·webkit 모두 통과한다. --- tests/e2e/tech-log-studio-workflow.spec.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tests/e2e/tech-log-studio-workflow.spec.ts b/tests/e2e/tech-log-studio-workflow.spec.ts index e81fa4b..0984e3f 100644 --- a/tests/e2e/tech-log-studio-workflow.spec.ts +++ b/tests/e2e/tech-log-studio-workflow.spec.ts @@ -1,10 +1,15 @@ import { FIXTURE_IDS } from "../../src/features/tech-log/adapters/mock/fixtures.ts"; import { expect, test } from "../support/browser/strict-browser-test.ts"; +import { gotoTechLogStudio } from "../support/browser/tech-log-fixtures.ts"; +// The mock validation of a saved version is valid for 30 minutes on +// 2026-08-14, so these run on the fixture clock (`gotoTechLogStudio`), like +// every other Studio browser test; on the real clock the result reads as stale. test("validates, previews, publishes, and unpublishes one Studio working copy", async ({ page, }) => { - await page.goto( + await gotoTechLogStudio( + page, `/studio/documents/${FIXTURE_IDS.stateNonceReference}/validation`, ); await expect( @@ -49,7 +54,8 @@ test("validates, previews, publishes, and unpublishes one Studio working copy", test("renders an immutable historical snapshot and Studio-local missing event", async ({ page, }) => { - await page.goto( + await gotoTechLogStudio( + page, `/studio/publications/${FIXTURE_IDS.fetchPublishedEvent}/preview`, ); await expect( @@ -59,7 +65,8 @@ test("renders an immutable historical snapshot and Studio-local missing event", page.getByText("게시 후 본문 측정값을 보완한 저장본입니다."), ).toHaveCount(0); - await page.goto( + await gotoTechLogStudio( + page, "/studio/publications/99999999-9999-4999-8999-999999999999/preview", ); await expect( From cfe587c13e25c38ead5ab431939f374a02d27501 Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Thu, 12 Nov 2026 15:03:16 +0900 Subject: [PATCH 5/9] =?UTF-8?q?test(e2e):=20HTTP=20=EA=B3=84=EC=95=BD=20?= =?UTF-8?q?=EC=8B=9C=ED=97=98=EC=9D=B4=20=EA=B2=BD=EB=A1=9C=20=ED=8C=A8?= =?UTF-8?q?=ED=84=B4=EC=9C=BC=EB=A1=9C=20=EC=84=9C=EB=B9=99=ED=95=98?= =?UTF-8?q?=EB=8A=94=20=EC=A7=80=EA=B8=88=20=EC=84=9C=EB=B2=84=EB=A5=BC=20?= =?UTF-8?q?=EB=94=B0=EB=A5=B8=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 6784eb1(08-20)부터 운영 서버는 빌드가 본 slug 목록이 아니라 등록된 Public 경로 패턴으로 SPA를 낸다. 빌드 뒤에 게시한 기록도 열려야 하기 때문이다. 그래서 /projects/missing-project는 이제 200으로 SPA를 받고, 화면 안에서 not-found를 보인다. 시험은 아직 그 경로가 edge 404라고 기대해 세 엔진 모두 떨어진다. 모르는 slug는 200 SPA를 기대한다. edge 404 사례는 경로 매개변수가 한 segment만 맞는다는 것을 보이는 /projects/missing-project/unknown-tab으로 바꾼다. 경로가 없는 /definitely-not-a-product-route는 그대로 둔다. 검증: tech-log-http-contract.spec.ts가 세 엔진 모두 통과한다. --- tests/e2e/tech-log-http-contract.spec.ts | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/tests/e2e/tech-log-http-contract.spec.ts b/tests/e2e/tech-log-http-contract.spec.ts index 9563094..0ab228a 100644 --- a/tests/e2e/tech-log-http-contract.spec.ts +++ b/tests/e2e/tech-log-http-contract.spec.ts @@ -34,8 +34,24 @@ for (const path of knownSpaPaths) { }); } +// 6784eb1 (08-20). The server matches each registered Public route as a +// pattern, not the slugs the build saw, so a record published after the build +// is reachable. A slug nobody published is the SPA's in-shell not-found, not an +// edge 404. +test("production HTTP serves the SPA for a slug the build has not seen", async ({ + request, +}) => { + const response = await request.get("/projects/missing-project"); + + expect(response.status()).toBe(200); + expect(response.headers()["content-type"]).toBe("text/html;charset=UTF-8"); + expect((await response.text()).startsWith("")).toBe(true); +}); + +// A route parameter matches one segment, so a second segment is still an edge +// 404, as is a path no route declares. for (const path of [ - "/projects/missing-project", + "/projects/missing-project/unknown-tab", "/definitely-not-a-product-route", ]) { test(`production HTTP returns the source-exact raw 404 for ${path}`, async ({ From c408cc2e0e6e01fff04ae7425f3eee336edb4017 Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Thu, 12 Nov 2026 15:03:16 +0900 Subject: [PATCH 6/9] =?UTF-8?q?test(e2e):=20=ED=85=9C=ED=94=8C=EB=A6=BF?= =?UTF-8?q?=EC=97=90=EC=84=9C=20=EC=98=A8=20=ED=99=94=EB=A9=B4=20=EC=8B=9C?= =?UTF-8?q?=ED=97=98=EC=9D=84=20TechLog=20=ED=99=94=EB=A9=B4=EC=9C=BC?= =?UTF-8?q?=EB=A1=9C=20=EC=98=AE=EA=B8=B4=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 09-29 템플릿 동기화(c80320d, ebea300→af3d8e6)가 템플릿 e2e 시험을 그대로 들여왔다. 그 시험은 이 제품이 지운 템플릿 예시 화면을 연다. - app-shell: 제목 「Tech Log」(지금 브랜드는 「TechLog」), 템플릿 drawer의 「메뉴」 버튼과 /examples/states. - production-csp: 제목 「Clean Architecture Frontend」와 「화면 상태」 링크. - scroll-restoration: /examples/ui와 .app-shell__header. 그래서 세 엔진 모두에서 요소를 찾지 못해 떨어진다. 같은 동작을 TechLog 화면으로 본다. - 홈 제목은 TechLog, 이동할 화면은 주요 탐색의 「프로젝트」. - drawer는 TechLog의 details.mobile-nav와 「모바일 주요 탐색」. - 긴 화면은 Case(1280x720에서 약 6,000px), 해시 대상은 그 안의 h2. - production-csp는 경로가 바뀐 것을 URL과 제목으로만 확인한다. 초점은 app-shell 시험이 따로 본다. 그래야 초점 결함과 상관없이 CSP 검사가 돈다. 위험·한계: 옮긴 시험 가운데 셋은 제품이 그 동작을 하지 않아 여전히 떨어진다. 시험을 고쳐서 생긴 실패가 아니라, 템플릿 이름 때문에 가려져 있던 실패다. - 경로 이동 뒤 초점: app-router.tsx는 「shell이 초점을 맡는다」며 이동을 뺐지만, TechLog Public shell에는 초점 처리가 없다. drawer 링크로 이동해도 새 화면의 제목으로 초점이 가지 않는다. - 뒤로 가기 스크롤 복원: Case에서 900px 내려갔다가 다른 화면에 갔다 돌아오면 0이다. - 해시로 연 Case에서 대상 h2로 스크롤하지 않는다. TechLog 화면은 해시를 처리하는 PageHeader를 쓰지 않는다(project-decisions-page만 따로 처리). 정할 것(초점 정책)이 있어 이 PR에서 제품을 고치지 않는다. 검증: production-csp는 세 엔진 모두 통과한다. 첫 번째 app-shell 시험(홈 부팅)과 scroll-restoration의 화면 열기까지는 통과하고, 위 세 동작에서 떨어진다. --- tests/e2e/app-shell.spec.ts | 34 ++++++++++++---------------- tests/e2e/production-csp.spec.ts | 16 ++++++++----- tests/e2e/scroll-restoration.spec.ts | 26 ++++++++++++++------- 3 files changed, 42 insertions(+), 34 deletions(-) diff --git a/tests/e2e/app-shell.spec.ts b/tests/e2e/app-shell.spec.ts index a0455e9..88b6044 100644 --- a/tests/e2e/app-shell.spec.ts +++ b/tests/e2e/app-shell.spec.ts @@ -3,9 +3,7 @@ import { gotoTechLog } from "../support/browser/tech-log-fixtures.ts"; test("boots the public app shell", async ({ page }) => { await gotoTechLog(page, "/"); - await expect(page.getByRole("heading", { level: 1 })).toHaveText( - "Tech Log", - ); + await expect(page.getByRole("heading", { level: 1 })).toHaveText("TechLog"); await expect(page.getByRole("navigation", { name: "주요 탐색" })).toBeVisible(); await expect(page.getByRole("main")).toBeVisible(); }); @@ -40,25 +38,27 @@ test("provides an escape-dismissible mobile navigation", async ({ page }) => { await expect(menu).toBeFocused(); }); -// R3-6. A drawer link closes the modal drawer and changes the route in the -// same click. The drawer's deferred focus restore must not win over the new -// page's heading focus; Escape (no navigation) still returns to the menu. +// R3-6 (template sync af3d8e6). A drawer link closes the drawer and changes +// the route in the same click. The new page's heading takes focus; it must not +// go back to the menu. Upstream drives its own drawer and example page; this is +// TechLog's `details.mobile-nav` and a primary-navigation page. test("moves focus to the new page after a mobile drawer link, not back to the menu", async ({ page, }) => { await page.setViewportSize({ width: 390, height: 844 }); - await page.goto("/"); - const menu = page.getByRole("button", { name: "메뉴", exact: true }); - const navigation = page.getByRole("navigation", { name: "주요 탐색" }); + await gotoTechLog(page, "/"); + const drawer = page.locator("details.mobile-nav"); + const menu = drawer.locator("> summary"); + 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(menu).toHaveAttribute("aria-expanded", "false"); - const heading = page.getByRole("heading", { level: 1, name: "화면 상태" }); + await expect(page).toHaveURL(/\/projects$/); + await expect(drawer).not.toHaveAttribute("open", ""); + 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. + // Give any late restore (lazy route commit) time to run. await page.waitForTimeout(300); expect( await page.evaluate(() => { @@ -67,10 +67,4 @@ test("moves focus to the new page after a mobile drawer link, not back to the me }), ).toBe(true); await expect(menu).not.toBeFocused(); - - await menu.click(); - await expect(navigation).toBeVisible(); - await page.keyboard.press("Escape"); - await expect(navigation).toBeHidden(); - await expect(menu).toBeFocused(); }); diff --git a/tests/e2e/production-csp.spec.ts b/tests/e2e/production-csp.spec.ts index 954eafd..811ce0e 100644 --- a/tests/e2e/production-csp.spec.ts +++ b/tests/e2e/production-csp.spec.ts @@ -54,17 +54,21 @@ test("boots and changes route under the production security headers", async ({ p expect(response?.headers()["content-security-policy"]).toBe( securityHeaders["Content-Security-Policy"], ); - await expect(page.getByRole("heading", { level: 1 })).toHaveText( - "Clean Architecture Frontend", - ); + // Template sync (af3d8e6): TechLog's home and a primary-navigation page in + // place of upstream's example screens. + await expect(page.getByRole("heading", { level: 1 })).toHaveText("TechLog"); await page .getByRole("navigation", { name: "주요 탐색" }) - .getByRole("link", { name: "화면 상태" }) + .getByRole("link", { name: "프로젝트" }) .click(); + // Upstream also waits for route focus here. TechLog's Public shell does not + // move focus on navigation (app-router.tsx leaves it to the shell); that is + // app-shell.spec.ts's to check, so this smoke stays about the policy. + await expect(page).toHaveURL(/\/projects$/); await expect( - page.getByRole("heading", { level: 1, name: "화면 상태" }), - ).toBeFocused(); + page.getByRole("heading", { level: 1, name: "프로젝트" }), + ).toBeVisible(); expect(await cspViolations(page)).toEqual([]); }); diff --git a/tests/e2e/scroll-restoration.spec.ts b/tests/e2e/scroll-restoration.spec.ts index f4f99d8..b96b8d8 100644 --- a/tests/e2e/scroll-restoration.spec.ts +++ b/tests/e2e/scroll-restoration.spec.ts @@ -2,37 +2,47 @@ import { expect, test, type Page } from "../support/browser/strict-browser-test. const scrollY = (page: Page) => page.evaluate(() => Math.round(window.scrollY)); +// Template sync (af3d8e6). Upstream scrolls its long example page; this product +// deleted it, and a TechLog Case (about 6,000px at 1280x720) is the long page. +const LONG_PAGE = "/cases/collection-fetch-join-pagination"; +const LONG_PAGE_TITLE = "컬렉션 Fetch Join과 페이징은 왜 충돌하는가"; + // 08-08. Back restores where the user was; a new route starts at the top. +// The Case body fills in after the title, so the test waits for it 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(LONG_PAGE); + await expect(heading).toHaveText(LONG_PAGE_TITLE); + await expect(page.locator("main [aria-busy='true']")).toHaveCount(0); + await expect(page.locator("#remaining-cost")).toBeAttached(); 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("프로젝트"); await expect.poll(() => scrollY(page)).toBe(0); await page.goBack(); - await expect(heading).toHaveText("UI 구성요소"); + await expect(heading).toHaveText(LONG_PAGE_TITLE); await expect.poll(() => scrollY(page)).toBe(900); }); +// A section well below the first screen. The header is the TechLog site header. 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(`${LONG_PAGE}#separate-loading`); + const target = page.locator("#separate-loading"); await expect(target).toBeInViewport(); const top = await target.evaluate((element) => Math.round(element.getBoundingClientRect().top), ); const headerBottom = await page - .locator(".app-shell__header") + .locator(".site-header") .evaluate((element) => Math.round(element.getBoundingClientRect().bottom)); expect(top).toBeGreaterThanOrEqual(headerBottom); expect(await scrollY(page)).toBeGreaterThan(0); From 70f3125c8eefad9e9dc1097b7957eb38f12032ce Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Thu, 12 Nov 2026 15:03:16 +0900 Subject: [PATCH 7/9] =?UTF-8?q?test(e2e):=20=EB=B6=80=ED=8C=85=20=EC=8B=A4?= =?UTF-8?q?=ED=8C=A8=20fixture=EA=B0=80=20TechLog=20=EB=A9=94=EC=8B=9C?= =?UTF-8?q?=EC=A7=80=20=EC=B9=B4=ED=83=88=EB=A1=9C=EA=B7=B8=EB=A5=BC=20?= =?UTF-8?q?=EB=91=90=20=EB=B2=88=20=ED=95=A9=EC=B9=9C=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit boot-module-failure 시험은 빌드 사본의 installed-feature-messages.ts에서 `composeInstalledMessageCatalogs(\n INSTALLED_PRODUCT_FEATURE_MODULES,\n)`를 찾아 두 번 합치게 고친다. 같은 메시지 키가 두 번 들어가 모듈 평가 중에 예외가 나야 한다. 이 제품은 동기화 때 그 줄을 TechLog 카탈로그를 같이 합치는 배열로 바꿨다. 그래서 문자열을 찾지 못하고 빌드 전에 떨어진다. TechLog 카탈로그 줄을 두 번 넣는다. 키가 겹쳐 같은 TypeError가 난다. 한계: 이제 fixture는 의도대로 동작하지만 시험은 여전히 떨어진다. 제품 결함이다. 예외가 나는 모듈이 route-not-found 청크에 묶이고, 부팅 실패 화면(render-boot-failure 청크)이 그 청크에서 두 값을 import한다. 그래서 부팅 실패 화면도 그리지 못하고 「불러오는 중」이 계속된다. 27e342d(PR #6 전) 빌드도 같은 import를 가지고 있어 react-dom 청크 분리 때문은 아니다. 청크 구성을 고치는 일은 이 PR 밖이다. 검증: 빌드 사본에서 「Duplicate ko-KR message key: route.TECH_LOG_HOME.title」 TypeError가 route-not-found 청크에서 나는 것을 trace로 확인했다. --- tests/e2e/boot-module-failure.spec.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/e2e/boot-module-failure.spec.ts b/tests/e2e/boot-module-failure.spec.ts index 5e1f571..cbbbbfe 100644 --- a/tests/e2e/boot-module-failure.spec.ts +++ b/tests/e2e/boot-module-failure.spec.ts @@ -25,10 +25,12 @@ test.beforeAll(async () => { { name: "broken", edit: (root) => + // Template sync (af3d8e6): this product composes TechLog's catalogs + // next to the installed modules', so the duplicate is TechLog's. editOnce( path.join(root, "src/features/installed-feature-messages.ts"), - "composeInstalledMessageCatalogs(\n INSTALLED_PRODUCT_FEATURE_MODULES,\n)", - "composeInstalledMessageCatalogs([\n ...INSTALLED_PRODUCT_FEATURE_MODULES,\n ...INSTALLED_PRODUCT_FEATURE_MODULES,\n])", + " Object.freeze({ messages: TECH_LOG_MESSAGE_CATALOGS }),\n]", + " Object.freeze({ messages: TECH_LOG_MESSAGE_CATALOGS }),\n Object.freeze({ messages: TECH_LOG_MESSAGE_CATALOGS }),\n]", ), }, ]); From a124e114635649afabc817533424300e4d92f1a0 Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Thu, 12 Nov 2026 15:03:16 +0900 Subject: [PATCH 8/9] =?UTF-8?q?test(e2e):=20Service=20Worker=20=EA=B0=B1?= =?UTF-8?q?=EC=8B=A0=20=EC=8B=9C=ED=97=98=EC=9D=84=20=EC=9D=B4=20=EC=A0=9C?= =?UTF-8?q?=ED=92=88=EC=9D=98=20=EB=B9=8C=EB=93=9C=EC=97=90=20=EB=A7=9E?= =?UTF-8?q?=EC=B6=98=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit service-worker-update 시험이 두 가지를 템플릿 빌드 기준으로 가정한다. - 빌드 B에서 바꿀 route 화면으로 src/presentation/pages/not-found-page.tsx를 연다. 이 제품에는 없는 파일이라 beforeAll이 ENOENT로 떨어지고, 이 파일의 시험 넷이 전부 돌지 않는다. - 캐시 목록을 dist/assets/의 모든 파일과 비교한다. 템플릿 빌드는 그 폴더가 곧 정적 자산 집합이다. 이 제품은 두 방향으로 다르다. IBM Plex Mono의 .woff 대체 파일은 캐시 대상 확장자가 아니고(SW-RR-03, .woff2만), dist/media/의 SVG는 캐시 대상이다. 바꿀 화면은 같은 방식으로 lazy load되는 TechLog Public not-found 화면이다. 기대하는 캐시 목록은 빌드가 선언한 집합, 즉 생성기의 collectStaticAssets 결과다. route 청크가 사라졌는지 보는 곳은 그대로 dist/assets를 쓴다. 검증: service-worker-update.spec.ts 4개 시험이 chromium·firefox·webkit 모두 통과한다. --- tests/e2e/service-worker-update.spec.ts | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/tests/e2e/service-worker-update.spec.ts b/tests/e2e/service-worker-update.spec.ts index 3d0f2a7..77d2e8b 100644 --- a/tests/e2e/service-worker-update.spec.ts +++ b/tests/e2e/service-worker-update.spec.ts @@ -1,6 +1,7 @@ import { appendFile, readdir, readFile } from "node:fs/promises"; import path from "node:path"; +import { collectStaticAssets } from "../../scripts/generate-service-worker-assets.ts"; import { expect, test, type Page } from "../support/browser/strict-browser-test.ts"; import { prepareServiceWorkerBuilds, @@ -39,8 +40,10 @@ let builds: ServiceWorkerBuilds | undefined; // because they embedded the build ID; since 09-02 they do not, so two builds // of the same source emit the same route chunks. A dynamically imported // module keeps all its exports, so the extra export survives the bundler. +// Template sync (af3d8e6): upstream's not-found page is TechLog's Public one, +// lazy-loaded like upstream's by `tech-log-route-runtime.tsx`. const CHANGED_ROUTE_SOURCE = - "src/presentation/pages/not-found-page.tsx"; + "src/features/tech-log/presentation/public/pages/public-not-found-page.tsx"; test.beforeAll(async () => { test.setTimeout(180_000); @@ -89,6 +92,16 @@ async function hashedAssets(dist: string): Promise { .sort(); } +// Template sync (af3d8e6). Upstream compares the cache with every file under +// assets/, which is its whole static asset set. This product's set differs +// from that folder both ways: IBM Plex Mono's `.woff` fallbacks there are not +// cacheable (SW-RR-03), and `media/` files outside it are. So the expected set +// is the one the build declares, from the generator's own scan. +async function staticAssetSet(dist: string): Promise { + const manifest = await collectStaticAssets(dist, "expected", "expected"); + return manifest.assets.map((asset) => asset.url).sort(); +} + const headerCases = [ { name: "Content-Type: application/javascript", @@ -121,7 +134,7 @@ for (const { name, headers } of headerCases) { return { names, paths }; }); expect(cached.names).toHaveLength(1); - expect(cached.paths.sort()).toEqual(await hashedAssets(dist.a)); + expect(cached.paths.sort()).toEqual(await staticAssetSet(dist.a)); // The server really sent the headers under test. const assets = server.served.filter((response) => From 9077a8d987714df9ce020375300f47290349a80c Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Thu, 12 Nov 2026 15:03:17 +0900 Subject: [PATCH 9/9] =?UTF-8?q?test(e2e):=20=EC=98=A4=EB=9E=98=EB=90=9C=20?= =?UTF-8?q?=ED=83=AD=20=EC=8B=9C=ED=97=98=EC=9D=B4=20=ED=99=88=EC=97=90?= =?UTF-8?q?=EC=84=9C=20=EB=AF=B8=EB=A6=AC=20=EB=B0=9B=EC=A7=80=20=EC=95=8A?= =?UTF-8?q?=EB=8A=94=20=ED=99=94=EB=A9=B4=20=EC=B2=AD=ED=81=AC=EB=A5=BC=20?= =?UTF-8?q?=EC=93=B4=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit old-tab-chunk-recovery 시험은 A 빌드 탭을 연 채 B를 배포하고 「탐색」을 누른다. A의 탐색 청크가 서버에 없으니 탭이 한 번 B로 다시 불러와야 한다. 그런데 홈 화면이 탐색(과 프로필) 청크를 modulepreload로 미리 받는다. 탭이 이미 그 청크를 가지고 있어 서버에 묻지 않고, 다시 불러오기가 0번이라 떨어진다. 미리 받지 않는 「프로젝트」와 「주제」 화면으로 바꾼다. 허용하는 실패 요청 정규식도 그 두 청크 이름으로 바꾼다. 검증: 이 시험이 chromium·firefox·webkit 모두 통과한다. 홈에서 받는 route 청크 목록(explore·case·profile·search·not-found·home)은 빌드한 앱을 열어 performance 항목으로 확인했다. --- tests/e2e/old-tab-chunk-recovery.spec.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/e2e/old-tab-chunk-recovery.spec.ts b/tests/e2e/old-tab-chunk-recovery.spec.ts index ef4083a..e23f66a 100644 --- a/tests/e2e/old-tab-chunk-recovery.spec.ts +++ b/tests/e2e/old-tab-chunk-recovery.spec.ts @@ -21,10 +21,12 @@ import { startBuildServer } from "./support/service-worker-builds.ts"; // Template sync (af3d8e6). Upstream uses two of its example pages, which this // product deleted; two TechLog primary-navigation pages play the same part. -const PLATFORM = ROUTE_REGISTRY.TECH_LOG_EXPLORE; +// Not Explore: the home page preloads the Explore (and Profile) chunk, so a +// tab on A already holds it and never asks the server for it again. +const PLATFORM = ROUTE_REGISTRY.TECH_LOG_PROJECTS; const UI = ROUTE_REGISTRY.TECH_LOG_TOPICS; const PAGES = [ - "src/features/tech-log/presentation/public/pages/explore-page.tsx", + "src/features/tech-log/presentation/public/pages/projects-page.tsx", "src/features/tech-log/presentation/public/pages/topics-page.tsx", ] as const; @@ -63,7 +65,7 @@ async function routeChunk(dist: string, chunkId: string): Promise { // may also log the 404 itself (without its URL), Firefox logs the error // object React caught, and WebKit logs its own import error without the URL. // Nothing else is allowed. -const MISSING_PAGE = String.raw`/assets/route-tech-log-(?:explore|topics)-[\w-]+\.js`; +const MISSING_PAGE = String.raw`/assets/route-tech-log-(?:projects|topics)-[\w-]+\.js`; test.use({ allowedBrowserFailure: new RegExp( [