"""276 단가연결 — 연결 없음 = 옛 길(단가연결 목록 → 옵션 값 창) · 연결 있음 = 「운반 단가」 모달(작게) · B08 거리이정표 · B09 운반공 줄 같음 · 옛 길 연결(own 없음 · 빈칸)도 서버가 그 행 거리로 채움.""" import re import sys from pathlib import Path ROOT = Path(__file__).resolve().parents[2] sys.path.insert(0, str(ROOT)) from B08_Quantity.B08_Quantity_Haul_Cycle import fill_given # noqa: E402 from B09_Estimation.B09_Estimation_Sangeun import _input_names # noqa: E402 def _src(name: str) -> str: return re.sub(r"\s+", " ", (ROOT / name).read_text(encoding="utf-8")) def test_연결_있으면_운반_모달_없으면_옛_길(): milestone = _src("B08_Quantity/B08_Quantity_UI_Milestone.ts") assert "() => route.ref ? openHaulModal({ ref: route.ref as Row," in milestone assert ": void openPriceLink({ apply: link })," in milestone link = _src("B09_Estimation/B09_Estimation_UI_Tabs_Bill_Link.ts") assert '[["단가연결", haul && ref ? haulModal : priceLink]]' in link # 옛 길 = 목록에서 로직 고르면 옵션 값 창(askInputs) assert 'if (p.kind === "logic") askInputs(o.apply, p.code, p.name);' in link def test_운반_모달_작게(): modal = _src("B09_Estimation/B09_Estimation_UI_Haul_Modal.ts") assert '"--modal-max:min(680px,86vh);width:min(1100px,94vw);height:var(--modal-max)"' in modal assert "min-height:60vh" not in modal and "flex:1;min-height:0" in modal def test_옛_길_연결도_거리로_채움(): ref = {"tab": "logic", "code": "GF000284", "given": {}} # askInputs 꼴 — own 없음 · 빈칸 got = fill_given(ref, _input_names("GF000284"), {"L1": 23.8, "L2": 10.5}) assert got["운반거리"] == 34.3