- app_shell ☰ 설정 묶음에 [설정] 단추(서랍 닫고 창은 처음 누를 때 불러옴) - 새 app_settings.ts(틀 · 탭 셋 · [저장] · askLeave) · app_settings_cad.ts(명령 표 · 내 별칭 · 검사) · app_settings.css - 새 openwebcad/src/commands/command-catalog.json(명령 153 · 한글 이름 · 기본 별칭) + 거울 시험 - locale 문구(ui_template_locale_common) - 시험: test_app_settings · cad/command-catalog 새로 · test_device_audit · test_touch_bridge 화면 주소 환경값(AISLO_UI_BASE · AISLO_UI_PROJECT) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QfHKQs7J3hQELKMWQMUJEy
29 lines
1.3 KiB
TypeScript
29 lines
1.3 KiB
TypeScript
/**
|
|
* CAD 명령 목록 거울(PLAN 332-2) — `commands/command-catalog.json` 이 registry(`commands.*.ts`)와 같은지.
|
|
* ☰ [설정] CAD 단축키 탭은 xstate 가 딸려 오지 않게 JSON 만 읽음 — 명령을 더하거나 별칭을 바꾸면 JSON 도 같이.
|
|
* 실행: cd B07_DesignDetail/openwebcad && npx vitest run --dir ../../resources/tester/cad command-catalog
|
|
*/
|
|
import { describe, expect, it } from "vitest";
|
|
|
|
import catalog from "../../../B07_DesignDetail/openwebcad/src/commands/command-catalog.json";
|
|
import { getAllCommands } from "../../../B07_DesignDetail/openwebcad/src/commands/registry";
|
|
|
|
describe("command-catalog.json", () => {
|
|
it("registry 와 같은 명령 · 한글 이름 · 기본 별칭 · 차례", () => {
|
|
const live = getAllCommands().map((c) => ({
|
|
id: c.id,
|
|
label: c.label,
|
|
aliases: c.aliases ?? [],
|
|
}));
|
|
expect(catalog).toEqual(live);
|
|
});
|
|
|
|
it("기본 별칭 = 영문 · 숫자 · 안 겹침 · 명령 이름과 다름", () => {
|
|
const ids = new Set(catalog.map((c) => c.id));
|
|
const aliases = catalog.flatMap((c) => c.aliases);
|
|
expect(aliases.every((a) => /^[A-Z0-9]+$/.test(a))).toBe(true);
|
|
expect(new Set(aliases).size).toBe(aliases.length);
|
|
expect(aliases.filter((a) => ids.has(a))).toEqual([]);
|
|
});
|
|
});
|