Files
tech-log-frontend/tests/features/tech-log/navigation-derivation.test.ts
T
DongHyeonkaandClaude Opus 5 bb6eba00db fix: UX 리뷰의 출시 차단 다섯 건을 고친다
B1. 검증·미리보기 화면이 CSS 없이 배포됐다. `workflow.module.css` 를 import
하는 파일이 하나도 없었고, Vite 의 CSS Module 은 import 되어야 번들에 들어간다.
제목이 62px 가 아니라 16px 로 나왔고 미리보기의 링크 두 개가 공백 없이 붙었다.
규칙이 전부 `:global()` 이었으므로 모듈일 이유가 없다 — studio.css 로 옮겼다.

B2. Asset 라이브러리에 스타일이 없고 진입 경로도 없었다. 네 클래스에 규칙이
하나도 없어 key·상태·사용 수가 공백 없이 이어 붙었다. 스무 개짜리 목록에
썸네일도 없어 무엇을 고르는지 눌러 봐야 알았다. 내비게이션에도 없어서 URL 을
직접 쳐야 닿았다 — "정리하는 화면" 에 정리하러 갈 길이 없었다.

B3. 삭제에 확인이 없었다. 문서·주제·프로젝트·릴리즈·Asset 전부 한 번에 영구
삭제였고, 그 「삭제」가 행에서 시각적으로 가장 강한 요소였다(16px/600 빨강).
정작 그 행에서 해야 할 일인 「검증하기」는 13px/400 이었다. 확인 창을 하나
만들어 다섯 곳에 붙이고, 행의 우선순위를 되돌렸다.

B4(일부). robots.txt 가 광고하던 sitemap 이 404 였다. 무엇이 게시됐는지는
서버만 알므로 정적 파일이 아니라 조회로 만든다(백엔드 커밋 참조). robots.txt
가 그 주소를 가리키게 했다.

B5. 라우트 프리픽스 밖 URL 이 nginx 의 맨 `Not Found` 로 끝났다. 404 상태는
그대로 두고 — 크롤러에게 링크가 깨졌다고 말하는 것이 그것이다 — 본문만 앱을
주도록 `error_page 404 @not_found` 를 뒀다.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PTnWufiY9ATv57egkKKVAV
2026-09-09 15:31:05 +09:00

64 lines
2.2 KiB
TypeScript

import { describe, expect, it } from "vitest";
import { techLogNavigation } from "../../../src/features/tech-log/presentation/tech-log-navigation.ts";
import { TECH_LOG_ROUTE_REGISTRY } from "../../../src/features/tech-log/contracts/tech-log-route-contract.ts";
/**
* The headers used to repeat the route contract's navigation facts in their own
* literal arrays, so a renamed route or a reordered menu could be right in one
* place and stale in the other. These pin the derived result against the shape
* the headers rendered before the change, and against the contract itself.
*/
describe("TechLog navigation derivation", () => {
it("derives the public menu in contract order", () => {
expect(
techLogNavigation("PUBLIC").map((entry) => [entry.label, entry.path]),
).toEqual([
["탐색", "/explore"],
["주제", "/topics"],
["프로젝트", "/projects"],
["프로필", "/profile"],
]);
});
it("derives the studio menu in contract order", () => {
expect(
techLogNavigation("STUDIO").map((entry) => [entry.label, entry.path]),
).toEqual([
["작업본", "/studio/documents"],
["게시 기록", "/studio/publications"],
["새 문서", "/studio/documents/new"],
["주제·프로젝트", "/studio/taxonomy"],
["Asset", "/studio/assets"],
["릴리즈", "/studio/releases"],
]);
});
it("advertises exactly the routes the contract marks navigable", () => {
const navigable = Object.values(TECH_LOG_ROUTE_REGISTRY)
.filter((definition) => definition.navigationOrder !== null)
.map((definition) => definition.routeId)
.sort();
const derived = [
...techLogNavigation("PUBLIC"),
...techLogNavigation("STUDIO"),
]
.map((entry) => entry.routeId)
.sort();
expect(derived).toEqual(navigable);
});
it("keeps each shell's entries inside its own layout group", () => {
for (const group of ["PUBLIC", "STUDIO"] as const) {
for (const entry of techLogNavigation(group)) {
expect(
TECH_LOG_ROUTE_REGISTRY[
entry.routeId as keyof typeof TECH_LOG_ROUTE_REGISTRY
]?.layoutGroup,
entry.routeId,
).toBe(group);
}
}
});
});