fix(CAD): 339 덧고침 — CAD 시작 상태를 「명령:」 쉼(선택 도구)으로 · 선 명령으로 시작하던 것 고침 · 시작 도구 시험
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QfHKQs7J3hQELKMWQMUJEy
This commit is contained in:
@@ -174,9 +174,8 @@ function initApplication() {
|
||||
|
||||
startDrawLoop(screenCanvasDrawController, 0);
|
||||
|
||||
const lineToolActor = new Actor(TOOL_STATE_MACHINES[Tool.LINE]);
|
||||
lineToolActor.start();
|
||||
setActiveToolActor(lineToolActor);
|
||||
// 오토캐드처럼 「명령:」 쉼(선택 도구)으로 시작
|
||||
setActiveToolActor(new Actor(TOOL_STATE_MACHINES[Tool.SELECT]));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
* 설계 `docs/raw/조사/2026-10-15_337_CAD오토캐드조작_설계.md` 2 장 · 6-3 가 줄.
|
||||
* 실행: cd B07_DesignDetail/openwebcad && npx vitest run --dir ../../resources/tester/cad prompt-frame
|
||||
*/
|
||||
import { readFileSync } from "node:fs";
|
||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
vi.mock("react-toastify", () => ({
|
||||
@@ -21,6 +22,7 @@ import {
|
||||
remember,
|
||||
renderPrompt,
|
||||
} from "../../../B07_DesignDetail/openwebcad/src/commands/prompt";
|
||||
import { TOOL_STATE_MACHINES } from "../../../B07_DesignDetail/openwebcad/src/commands/registry";
|
||||
import {
|
||||
getLastCommandId,
|
||||
runCommandInput,
|
||||
@@ -418,6 +420,24 @@ describe("엔진 v2 — loopFrom · when · mode · next · escCommits · undo
|
||||
});
|
||||
|
||||
describe("쉼 · 명령 이름 · 별칭(2-5 ⑨ · 2-17 · N18)", () => {
|
||||
it("앱 시작 = 쉼(선택 도구) — main.tsx 가 켜는 도구 · 「l ⏎」 = 첫 번째 점 지정", () => {
|
||||
const main = readFileSync(
|
||||
new URL("../../../B07_DesignDetail/openwebcad/src/main.tsx", import.meta.url),
|
||||
"utf8",
|
||||
);
|
||||
const started = [...main.matchAll(/TOOL_STATE_MACHINES\[Tool\.(\w+)\]/g)].map((m) => m[1]);
|
||||
expect(started).toEqual(["SELECT"]);
|
||||
start(TOOL_STATE_MACHINES[Tool.SELECT]);
|
||||
expect(activeTool()).toBe(Tool.SELECT);
|
||||
const idle = promptLine();
|
||||
expect(idle).not.toBe("첫 번째 점 지정:");
|
||||
typeEnter("l");
|
||||
expect(activeTool()).toBe(Tool.LINE);
|
||||
expect(promptLine()).toBe("첫 번째 점 지정:");
|
||||
key("Escape");
|
||||
expect(promptLine()).toBe(idle);
|
||||
});
|
||||
|
||||
it("딱 맞음만 — R · LE · CIR · SE = 알 수 없는 명령 · l = LINE · ed = TEXTEDIT", () => {
|
||||
for (const text of ["r", "le", "cir", "se"]) {
|
||||
type(text);
|
||||
|
||||
Reference in New Issue
Block a user