Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018jonfdxn1Xit9bdkNJpE4G
43 lines
1.9 KiB
Python
43 lines
1.9 KiB
Python
"""255-3 거리이정표 거래처 · 기준점 모달 — 칸 이름 ≥ 내용 글 · 「소재지 — 주소 찾기 · 지도에서 고르기」
|
|
줄 지움 · 기준점 이름 한 줄(빈 칸 자리 비움) · 주소 · 지도 위 가로선 ·
|
|
256-1 장소 그림 = 등록 · 좌표 바뀜 · 경로 탭 끌기 뒤 capturePlace."""
|
|
|
|
import re
|
|
from pathlib import Path
|
|
|
|
ROOT = Path(__file__).resolve().parents[2]
|
|
|
|
|
|
def _read(rel):
|
|
return (ROOT / rel).read_text(encoding="utf-8")
|
|
|
|
|
|
def _rule(css, selector):
|
|
m = re.search(re.escape(selector) + r" \{([^}]*)\}", css)
|
|
assert m, selector
|
|
return m.group(1)
|
|
|
|
|
|
def test_모달_꼴():
|
|
modal = _read("B08_Quantity/B08_Quantity_UI_Milestone_Modal.ts")
|
|
assert "주소 찾기 · 지도에서 고르기" not in modal and 'el("h4"' not in modal
|
|
assert (
|
|
'item.root.style.display = dest.root.style.display = k === "base" ? "none" : "";' in modal
|
|
)
|
|
css = _read("B08_Quantity/B08_Quantity_UI_Milestone.css")
|
|
label = _rule(css, ".b08-milestone__modal .ui-field__label")
|
|
assert "font-size: var(--text-body-sm);" in label # 입력 글(text-body-sm)과 같음
|
|
assert "white-space: nowrap;" in label
|
|
assert "border-top: 1px solid var(--color-border);" in _rule(css, ".b08-milestone__place-field")
|
|
place = _read("B08_Quantity/B08_Quantity_UI_Milestone_Place.ts")
|
|
assert 'className: "b08-milestone__place-field"' in place
|
|
|
|
|
|
def test_장소_그림_캡처_부름():
|
|
modal = _read("B08_Quantity/B08_Quantity_UI_Milestone_Modal.ts")
|
|
assert modal.count("segment = placed = ") == 2 # 기준점 · 거래처 좌표 바뀜
|
|
assert "placed = addRoute?.({" in modal and "id: placed," in modal # 새 거래처 · 새 기준점
|
|
assert "void capturePlace(projectId, placed, {" in modal
|
|
route = _read("B08_Quantity/B08_Quantity_UI_Milestone_Route.ts")
|
|
assert "void capturePlace(projectId, key, { name: target.name || label, lon, lat });" in route
|