- 분할 고르기 부품에 풂 꼴(clearable) · 부품 모음 견본에 더함 - 방식 칸(map_draw_kind)에 켬끔 꼴(onActive · setActive) — 켬 = 긋기 시작 · 고른 방식 다시 누름 = 긋기 끝 · 긋는 중 다른 방식 = 방식만 바뀜 - D03 · B05 그리기 칸 [긋기] 단추 걷음 · 긋기가 Enter · Esc · 붙어 끝나도 칸 켬 맞춤 · 노드 판은 그대로 - 시험 757_1 새로 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
32 lines
1.4 KiB
Python
32 lines
1.4 KiB
Python
"""757-1 (요구 589-9) — 그리기 칸 [긋기] 단추 걷음 · 방식 넷 켬끔 = 긋기 시작 · 끝(D03 · B05 같은 칸).
|
|
|
|
./venv/Scripts/python.exe -m pytest resources/tester/test_757_1_draw_kind_toggle.py -q
|
|
"""
|
|
|
|
from pathlib import Path
|
|
|
|
ROOT = Path(__file__).resolve().parents[2]
|
|
read = lambda *parts: ROOT.joinpath(*parts).read_text(encoding="utf-8") # noqa: E731
|
|
|
|
|
|
def test_분할_고르기_풂_꼴() -> None:
|
|
src = read("ui_template", "ui_template_segment.ts")
|
|
assert "clearable?: boolean" in src and 'opts.onChange?.("")' in src
|
|
|
|
|
|
def test_방식_칸_켬끔_꼴() -> None:
|
|
src = read("A00_Common", "map", "map_draw_kind.ts")
|
|
assert "onActive?: (on: boolean) => void" in src and "setActive" in src
|
|
assert "clearable: !!opts.onActive" in src # onActive 없는 곳(노드 판)은 늘 하나 고름
|
|
props = read("D03_PlanAnalysis", "D03_PlanAnalysis_UI_Props.ts")
|
|
assert "onActive" not in props
|
|
|
|
|
|
def test_긋기_단추_없고_방식_칸이_시작_끝() -> None:
|
|
panel = read("D03_PlanAnalysis", "D03_PlanAnalysis_UI_DrawPanel.ts")
|
|
assert "onDraw:" not in panel and '"긋기 끝"' not in panel and 'label: "긋기"' not in panel
|
|
assert "opts.kind.setActive(drawing)" in panel
|
|
draw = read("D03_PlanAnalysis", "D03_PlanAnalysis_UI_Draw.ts")
|
|
assert 'on !== (mode === "draw") && setMode(on ? "draw" : "idle")' in draw
|
|
assert "onDraw:" not in draw
|