- 1-A 도면 GET · 저장 PUT 한도 60 s · 저장 중 미리받기 쉼 · 끊긴 저장 = 목록 confirmed 로 판정
- 2 CAD 자동백업 열쇠 = b07:{프로젝트}:{도면} · 도각 편집 = b07-frame:{프로젝트} · [초기화] 같은 열쇠
- 3-1 [초기화] 물음 글 = 프로젝트 도각 그대로 · [도각 편집] → [기본 도각 복원] 안내
- 3-2 풀린 장 저장본 json · 수량표 찌꺼기 걷음(_write_manifest 한 곳)
- 5-1 확정 풀기 · 배치 · 축척 = mark_stage(save)
- 7-3 start_stage 가 DEV_UNLOCK 표식 남김
- 6-a navigateDrawing · onNavigate · hasPrev · hasNext 걷음 · 6-b cad-host-save 토글 걷음 · 4-2 B08 안 쓰는 글 11 걷음
- 6-f 특성 판 색 끌기 = 되돌리기 한 칸(paintNowCommitLater 한 벌) · 6-g LAYMRG 사본 길
- 4-1 B09 [인쇄 미리보기] = 저장 뒤 이동 · 단계 그대로 · 6-e M02 카드 도움말 DWG 한 줄
- 시험 test_506_3_* 둘 · cad/undo-506-3 · test_298_2_b07_buttons 열쇠 맞춤
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
112 lines
4.3 KiB
Python
112 lines
4.3 KiB
Python
# -*- coding: utf-8 -*-
|
|
"""506-3 나 · 다 · 정함 — 죽은 길 걷음 · CAD 되돌리기 이음 · B09 [인쇄 미리보기] · M02 도움말.
|
|
|
|
못박는 것
|
|
6-a 이전 · 다음 도면 길(navigateDrawing · onNavigate · aislo:b08:navigate · hasPrev · hasNext) 없음.
|
|
6-b CAD `cad-host-save` 클래스 토글 없음(CSS 규칙 0).
|
|
4-2 B08 안 쓰는 로케일 글 11 없음.
|
|
6-f 특성 판 색 칸 = `paintNowCommitLater`(리본과 한 벌 · `selection-style.ts`) — 동작은 vitest `cad/undo-506-3`.
|
|
4-1 B09 [인쇄 미리보기] = 저장(`DRAFT.save`) 성공 뒤 이동 · 실패면 머묾 · 단계 그대로(complete 안 부름).
|
|
6-e M02 카드 단축키 도움말에 DWG 불러오기 한 줄.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
import json
|
|
import os
|
|
import subprocess
|
|
from pathlib import Path
|
|
|
|
HERE = os.path.dirname(os.path.abspath(__file__))
|
|
ROOT = Path(HERE).parents[1]
|
|
CAD = ROOT / "B07_DesignDetail" / "openwebcad" / "src"
|
|
|
|
|
|
def _read(path: Path) -> str:
|
|
return path.read_text(encoding="utf-8").replace("\r\n", "\n")
|
|
|
|
|
|
def test_6a_이전_다음_길_없음():
|
|
page = _read(ROOT / "B07_DesignDetail" / "B07_DesignDetail_UI_Page.ts")
|
|
host = _read(ROOT / "ui_template" / "cad_host" / "cad_host.ts")
|
|
types = _read(CAD / "App.types.ts")
|
|
for text, words in (
|
|
(page, ("navigateDrawing", "onNavigate", "hasPrev", "hasNext")),
|
|
(host, ("onNavigate", "aislo:b08:navigate", "direction")),
|
|
(types, ("hasPrev", "hasNext")),
|
|
):
|
|
for word in words:
|
|
assert word not in text, word
|
|
|
|
|
|
def test_6b_host_save_클래스_없음():
|
|
state = _read(CAD / "state.ts")
|
|
assert "cad-host-save" not in state
|
|
assert "export const setHostSave" in state and "export const isHostSave" in state
|
|
|
|
|
|
def test_4_2_안_쓰는_글_없음():
|
|
locale = _read(ROOT / "ui_template" / "ui_template_locale_b2.ts")
|
|
for key in (
|
|
"B08_Quantity_Side_Pending",
|
|
"B08_Quantity_Btn_Confirm",
|
|
"B08_Quantity_Confirm_Success",
|
|
"B08_Quantity_Confirm_Failed",
|
|
"B08_Quantity_Dev_Title",
|
|
"B08_Quantity_Dev_Unlock",
|
|
"B08_Quantity_Dev_Relock",
|
|
"B08_Quantity_Dev_Bypassed",
|
|
"B08_Quantity_Dev_Normal",
|
|
"B08_Quantity_Dev_Done",
|
|
"B08_Quantity_Dev_Failed",
|
|
):
|
|
assert key not in locale, key
|
|
assert "B08_Quantity_Title" in locale
|
|
|
|
|
|
def test_6f_색_칸_한_벌():
|
|
style = _read(CAD / "helpers" / "selection-style.ts")
|
|
assert "export function paintNowCommitLater" in style
|
|
ribbon = _read(CAD / "components" / "RibbonWidgets.tsx")
|
|
assert "function paintNowCommitLater" not in ribbon and "paintNowCommitLater(" in ribbon
|
|
editor = _read(CAD / "components" / "PropertiesEditor.tsx")
|
|
color = editor[editor.index("<span>색상</span>") :]
|
|
color = color[: color.index("</label>")]
|
|
assert "paintNowCommitLater(styleTargets(getSelectedEntities())" in color
|
|
assert "applyToLines" not in color
|
|
|
|
|
|
def test_6g_laymrg_사본():
|
|
tools = _read(CAD / "tools" / "utility" / "layer-tools.ts")
|
|
merge = tools[tools.index("export const layerMergeToolStateMachine") :]
|
|
merge = merge[: merge.index("\n});")]
|
|
assert "restyle(" in merge
|
|
assert (
|
|
"entity.layerId = targetId;" in merge and "for (const entity of getEntities())" not in merge
|
|
)
|
|
|
|
|
|
def test_4_1_인쇄_미리보기_저장_뒤_이동():
|
|
proc = subprocess.run(
|
|
["node", os.path.join(HERE, "helper_506_3_b09_print.cjs")],
|
|
capture_output=True,
|
|
text=True,
|
|
encoding="utf-8",
|
|
timeout=60,
|
|
)
|
|
assert proc.returncode == 0, proc.stderr
|
|
out = json.loads(proc.stdout)
|
|
assert out["saved"] == ["save", "go:/b09-print"]
|
|
assert out["failed"] == ["save"]
|
|
shell = _read(ROOT / "B09_Estimation" / "B09_Estimation_UI_Shell.ts")
|
|
assert "DRAFT.save = saveChanged;" in shell
|
|
ui = _read(ROOT / "B09_Estimation" / "draft" / "B09_Draft_Print_UI.ts")
|
|
assert "complete" not in ui.split("DRAFT.actions.push(")[1] # 단계 그대로
|
|
|
|
|
|
def test_6e_m02_dwg_도움말():
|
|
card = _read(ROOT / "M02_MasterTemplete" / "M02_MasterTemplete_DrawingCard.ts")
|
|
keys = card[card.index("export const DRAWING_KEYS") :]
|
|
keys = keys[: keys.index("];")]
|
|
assert '["IMPORT · 파일 끌어 놓기", "DWG · DXF 불러오기(고치기 카드)"]' in keys
|