feat(M02): 엑셀 칸 고르기 모달 부품 AreaCellPick — 그 열 면적산출 읽기만 시트 · 칸 누름 = 주소 · 연결 풀기 · 순수 linkAreaCell(면적 문서 · 알약 키 · 칸) (PLAN 40-3 ①)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01W4uKaV4ZBhsJN4GHG7yRj4
This commit is contained in:
2026-10-04 22:23:27 +09:00
co-authored by Claude Opus 5.5
parent 9b6c2e7057
commit fda2527c4b
6 changed files with 183 additions and 2 deletions
@@ -1,7 +1,7 @@
/* setLink 순수 길(`spreadsheet_link_set.ts`) 시험 진입 — vite --ssr 로 번들해 Node 로 돌림.
* 결과 = JSON {pass, fail, failures} 한 줄(`test_spreadsheet_set_link.py` 가 읽음) */
import { applyCommand } from "../../../A00_Common/spreadsheet/spreadsheet_commands";
import { linkCommand } from "../../../A00_Common/spreadsheet/spreadsheet_link_set";
import { linkAreaCell, linkCommand } from "../../../A00_Common/spreadsheet/spreadsheet_link_set";
import type { Command, Workbook } from "../../../A00_Common/spreadsheet/spreadsheet_types";
let pass = 0;
@@ -89,4 +89,15 @@ eq("빈 주소", linkCommand(b, "s1", "깔기|㎡", ""), false);
eq("없는 시트", linkCommand(b, "s9", "깔기|㎡", "A1"), false);
eq("문서 그대로", links(b), links(book()));
// linkAreaCell — 새 문서(받은 문서 그대로) · 활성 시트 · 번호 칸 그대로 · 틀린 주소 null · 풀기
b = { ...book(), 면적번: "SA-000001" } as Workbook & { 면적번: string };
const before = JSON.stringify(b);
const got = linkAreaCell(b, "철근|ton", "c9", { 이름: "철근", 단위: "ton" });
eq("받은 문서 그대로", JSON.stringify(b), before);
eq("새 문서 연결", got?.시트[0].연결?.[1], { 키: "철근|ton", 칸: "C9", 이름: "철근", 단위: "ton" });
eq("번호 그대로", (got as { 면적번?: string } | null)?.면적번, "SA-000001");
eq("틀린 주소", linkAreaCell(b, "철근|ton", "9C"), null);
eq("풀기 · 시트 넘어", links(linkAreaCell(b, "치기|㎥", null)!), [links(book())[0], null]);
eq("바뀔 것 없음 = 사본", JSON.stringify(linkAreaCell(b, "깔기|㎡", "B6")), before);
console.log(JSON.stringify({ pass, fail: failures.length, failures }));
+11
View File
@@ -88,3 +88,14 @@ def test_카드_알약_취향은_계정_받은_뒤_올림():
cards = _text("M02_MasterTemplete_ItemCards.ts")
load = cards.split("async function load(")[1]
assert 'paintPills(readStateRaw("m02-card-pills") === "true");' in load
def test_엑셀_칸_고르기_모달_부품():
"""40-3 ① — 읽기만 시트 · 칸 누름 = 주소 · 풀기 = {칸: null} · 그만둠 = null · 저장 안 함."""
pick = _text("M02_MasterTemplete_AreaCellPick.ts")
assert 'export { linkAreaCell } from "../A00_Common/spreadsheet/spreadsheet_link_set";' in pick
assert "readOnly: true," in pick and "beforeClose: () => (finish(null), true)," in pick
assert "finish({ 칸: null })" in pick and "finish({ 칸: picked })" in pick
assert "if ((e as MouseEvent).button === 0 && moved) choose();" in pick
assert "handle?.destroy();" in pick
assert "saveTemplate" not in pick
@@ -55,7 +55,7 @@ def test_setLink_순수_길():
assert run.stdout.strip(), run.stderr
result = json.loads(run.stdout)
assert result["fail"] == 0, result["failures"]
assert result["pass"] == 13
assert result["pass"] == 19
def test_손잡이_setLink_몸():