refactor: 템플릿에서 기본적으로 제공하고 있는 워크 플로우에 디자인과 라우팅 흡수
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import {
|
||||
findTechLogBehavioralLiteralViolations,
|
||||
} from "../../scripts/lib/tech-log-i18n-policy.ts";
|
||||
|
||||
describe("TechLog behavioral i18n source policy", () => {
|
||||
it("rejects direct behavioral announcements, action labels, and error fallbacks", () => {
|
||||
const source = `
|
||||
setRequestAnnouncement("게시했습니다.");
|
||||
setNotice("삭제했습니다.");
|
||||
setSuccess("저장했습니다.");
|
||||
setRequestAnnouncement(\`주제 \${name} 을(를) 삭제했습니다.\`);
|
||||
studio.setRequestAnnouncement(\`버전 \${detail.document.version}으로 저장했습니다.\`);
|
||||
studio.setRequestAnnouncement("프로젝트 " + name + " 을(를) 만들었습니다.");
|
||||
<Button>다시 시도</Button>
|
||||
<Button pendingLabel="처리 중">저장</Button>
|
||||
<Link>다시 시도</Link>
|
||||
<OrderedItems empty="등록된 항목이 없습니다." />
|
||||
studioFailureMessage(failure, "저장하지 못했습니다. 다시 시도해 주세요.");
|
||||
<h1>페이지를 찾을 수 없습니다.</h1>
|
||||
`;
|
||||
|
||||
expect(findTechLogBehavioralLiteralViolations(source)).toHaveLength(13);
|
||||
});
|
||||
|
||||
it("allows domain/editorial headings, field labels, and status labels", () => {
|
||||
const source = `
|
||||
<h1>검색</h1>
|
||||
<label htmlFor="query">검색</label>
|
||||
<dt>게시</dt>
|
||||
const STATUS = { PUBLISHED: "공개", UNPUBLISHED: "게시 취소" };
|
||||
`;
|
||||
|
||||
expect(findTechLogBehavioralLiteralViolations(source)).toEqual([]);
|
||||
});
|
||||
|
||||
it("allows catalog-driven behavior and interpolation", () => {
|
||||
const source = `
|
||||
setRequestAnnouncement(copy("techLog.notice.documentDeleted", { title }));
|
||||
setNotice(copy("techLog.notice.assetDeleted"));
|
||||
<Button>{copy("techLog.action.retry")}</Button>
|
||||
studioFailureMessage(failure, copy("techLog.failure.saveRetry"));
|
||||
<h1>{copy("techLog.public.notFound")}</h1>
|
||||
`;
|
||||
|
||||
expect(findTechLogBehavioralLiteralViolations(source)).toEqual([]);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user