71 lines
3.3 KiB
Python
71 lines
3.3 KiB
Python
# -*- coding: utf-8 -*-
|
|
"""212-3 B07 좌측 「횡단도」 배치 칸 — 단추 · 숫자 칸 한 규격 · 한 줄에 한 일 · 남는 검은 선 판정.
|
|
|
|
못박는 것
|
|
- 줄 = 「배치 열 · 행」 · 「적용」 · 「표 배율」(⚙ 횡단 모달 그룹 상자 · 523-1)
|
|
· 단추([안내선 숨기기] [취소] [확인]) = 맨 아래 단추 줄 하나.
|
|
- 단추 · 숫자 칸 · 이름 = 좌측 패널 공용 양식(269 `.ui-panel-form`) · 한 줄 안 같은 너비.
|
|
- 옛 한 줄 감기(flex-wrap) · 숫자 칸 48px 고정 없음.
|
|
- 인쇄 칸선 없음(526-1 · 옛 「남는 검은 선」) — 칸은 안내선 겹판(단면마다 점선)이라
|
|
[안내선 숨기기] 뒤 남는 선 없음 · 단추는 겹판만 끔.
|
|
"""
|
|
|
|
import re
|
|
from pathlib import Path
|
|
|
|
from B07_DesignDetail import B07_DesignDetail_Engine_Cad_Sheet as sheet_engine
|
|
|
|
ROOT = Path(__file__).resolve().parents[2]
|
|
CSS = (ROOT / "B07_DesignDetail/B07_DesignDetail_UI_Style.css").read_text(encoding="utf-8")
|
|
PANELS = (ROOT / "B07_DesignDetail/B07_DesignDetail_UI_Panels.ts").read_text(encoding="utf-8")
|
|
SETTINGS = (ROOT / "B07_DesignDetail/B07_DesignDetail_UI_Settings.ts").read_text(encoding="utf-8")
|
|
GUIDE = (ROOT / "B07_DesignDetail/openwebcad/src/integration/guide-area.ts").read_text(
|
|
encoding="utf-8"
|
|
)
|
|
THEME = (ROOT / "ui_template/ui_template_theme.css").read_text(encoding="utf-8")
|
|
|
|
|
|
def _block(selector: str) -> str:
|
|
m = re.search(r"(?:^|\n)" + re.escape(selector) + r"\s*\{([^}]*)\}", CSS)
|
|
assert m, selector
|
|
return m.group(1)
|
|
|
|
|
|
def _decl(block: str, prop: str) -> str:
|
|
m = re.search(r"(?:^|;|\s)" + re.escape(prop) + r"\s*:\s*([^;]+);", block)
|
|
assert m, prop
|
|
return m.group(1).strip()
|
|
|
|
|
|
def test_단추_숫자_칸_한_규격_토큰():
|
|
# 269 — 크기는 좌측 패널 공용 양식(`.ui-panel-form`)이 줌 · B07 덧칠(줄 위 작은 단추 토큰) 없음
|
|
assert ".b07-cross-layout .ui-btn" not in CSS
|
|
assert ".b07-cross-layout .ui-field .ui-input {" in CSS # 폭만
|
|
assert "height" not in _block(".b07-cross-layout .ui-field .ui-input")
|
|
label = _block(".b07-cross-layout .ui-field__label")
|
|
assert "font-size" not in label
|
|
assert "createPanelCard(" in PANELS # 배치 칸이 사는 횡단도 묶음 = 공용 카드
|
|
|
|
|
|
def test_한_줄에_한_일_같은_너비():
|
|
box = _block(".b07-cross-layout")
|
|
assert _decl(box, "flex-direction") == "column"
|
|
assert "flex-wrap" not in box
|
|
assert _decl(_block(".b07-cross-layout__row > *"), "flex") == "1 1 0"
|
|
assert "width: 48px" not in CSS
|
|
assert 'row.className = "b07-cross-layout__row"' in SETTINGS
|
|
assert "line(cols.root, rows.root), line(scope.root)" in SETTINGS
|
|
assert "line(table.root)" in SETTINGS
|
|
# 안내선 단추 = 맨 아래 단추 줄(523-1) · ⚙ 횡단 모달(280-5)
|
|
assert "if (cross) footer.append(deps.cross.guideToggle);" in SETTINGS
|
|
|
|
|
|
def test_인쇄_칸선_없음_칸은_안내선_겹판():
|
|
assert not hasattr(sheet_engine, "_grid_lines") # 526-1 — 칸선 도면 개체 없음
|
|
# 칸 · 점선 영역 · 붉은 틀 모두 겹판 — 숨김이면 안 그림 · 도면 개체를 안 건드림
|
|
draw = GUIDE[GUIDE.index("export function drawGuide") :]
|
|
draw = draw[: draw.index("\n}\n")]
|
|
assert "if (!guide || !guideVisible) return;" in draw
|
|
assert "guide.cells" in draw
|
|
assert "getEntities" not in draw and "setEntities" not in draw
|