From 2420fcee9fa1e3ebbcffca6a4e92dbe1795d5084 Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Wed, 26 Aug 2026 23:55:19 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EA=B3=B5=EA=B0=9C=20=EB=AC=B8=EC=84=9C?= =?UTF-8?q?=EA=B0=80=20=EC=8B=A4=EC=A0=9C=EB=A1=9C=20=EA=B7=B8=EB=A6=AC?= =?UTF-8?q?=EB=8A=94=20=EC=A3=BC=EC=A0=9C=20=EB=A7=81=ED=81=AC=EB=8F=84=20?= =?UTF-8?q?=ED=83=90=EC=83=89=20=ED=95=84=ED=84=B0=EB=A1=9C=20=EB=8F=8C?= =?UTF-8?q?=EB=A6=B0=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 주제 링크를 고쳤는데 화면은 그대로 `/topics/:slug` 로 갔다. 공개 문서의 머리말을 그리는 것은 `PublicDocumentHeader` 의 breadcrumb 이 아니라 렌더 모델의 `topic.publicPath` 이고, 같은 파일 안에서 두 자리가 같은 경로를 만들고 있었다. 한 자리만 고쳤으니 배포하고 눌러 보기 전까지는 고친 것처럼 보였다. 테스트도 이 링크를 묻지 않고 있었다. 머리말 검사가 `Case/JPA/Backend Skeleton` 이라는 글자만 확인해서, 그 글자가 어디로 가는지는 아무도 보지 않았다. 되돌려 보면 공개 문서 여섯 개가 모두 빨개진다. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_0189NzCryfeqDzS81EWidnBx --- .../components/public-document-header.tsx | 4 +++- .../tech-log/public-document-screens.test.tsx | 19 +++++++++++++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/features/tech-log/presentation/public/components/public-document-header.tsx b/src/features/tech-log/presentation/public/components/public-document-header.tsx index ed98b68..6f561c1 100644 --- a/src/features/tech-log/presentation/public/components/public-document-header.tsx +++ b/src/features/tech-log/presentation/public/components/public-document-header.tsx @@ -63,7 +63,9 @@ export function publicRenderModelBase( topic: { id: `topic-${record.topicSlug}`, label: record.topic, - publicPath: `/topics/${record.topicSlug}`, + // 공개 문서의 머리말이 실제로 그리는 주제 링크는 이 값이다 — 위의 breadcrumb 과 같은 + // 이유로 탐색 필터를 가리킨다. 둘 중 하나만 고치면 화면에서는 그대로 404 로 간다. + publicPath: `/explore?topic=${encodeURIComponent(record.topicSlug)}`, }, project: { id: `project-${record.projectSlug}`, diff --git a/tests/features/tech-log/public-document-screens.test.tsx b/tests/features/tech-log/public-document-screens.test.tsx index 132ec34..cc74846 100644 --- a/tests/features/tech-log/public-document-screens.test.tsx +++ b/tests/features/tech-log/public-document-screens.test.tsx @@ -42,6 +42,13 @@ const routeComponents = { type DocumentRouteId = keyof typeof routeComponents; +/** 머리말이 거는 주제 링크를 확인하기 위한 픽스처의 이름 → slug 대응. */ +const topicSlugs: Readonly> = { + JPA: "jpa", + Authentication: "authentication", + Redis: "redis", +}; + class NoopIntersectionObserver implements IntersectionObserver { readonly root = null; readonly rootMargin = "0px"; @@ -211,8 +218,16 @@ describe("TechLog canonical Public documents", () => { */ const [firstEvidence] = within(main).getAllByText(evidence, { exact: false }); expect(firstEvidence).toBeVisible(); - expect(within(main).getByRole("navigation", { name: "문서 경로" })).toHaveTextContent( - `${kind}/${topic}/${project}`, + const breadcrumb = within(main).getByRole("navigation", { name: "문서 경로" }); + expect(breadcrumb).toHaveTextContent(`${kind}/${topic}/${project}`); + /* + 글자만 보고 있었더니 주제 링크가 어디로 가는지는 아무도 묻지 않았다. 그 링크는 + `/topics/:slug` 를 가리켰고, 그 화면은 세 개의 주제를 하드코딩해 두고 있어 실제 주제는 + 무엇이든 404 였다 — 게시한 모든 문서가 죽은 링크를 하나씩 달고 있었다. + */ + expect(within(breadcrumb).getByRole("link", { name: topic })).toHaveAttribute( + "href", + `/explore?topic=${topicSlugs[topic]}`, ); /*