"""160-2 B08 구조물 집계표 「미지정」 — 측점 옆 열 글 · 같은 조합 열 칸 표기(화면만). `B08_Quantity_Summary_Data.ts` 를 `common_util_summary_item.ts` 와 이어 붙여 node 로 돌림(61-1 시험과 같은 꼴). """ import json from pathlib import Path from test_61_1_b08_summary_table import _item, _run ROOT = Path(__file__).resolve().parents[2] def _slot(copy: str, group, item=None, linked=False) -> dict: return {"copy": copy, "group": group, "item": item, "linked": linked} FACILITIES = [ { "id": "pipe@100", "type_id": "pipe", "name": "배관", "facility": "pipe", "chainage_m": 100.0, "slots": [ _slot("pipe@100", None), _slot("pipe@100__gpipe", "관", _item("SS2")), _slot("pipe@100__gin", "관 보호공(유입)", _item("SS3"), linked=True), ], }, { "id": "s1", "type_id": "ford_bridge", "name": "세월교", "facility": None, "chainage_m": 100.004, "slots": [_slot("s1__gfordout", "유출 구조", {"key": "깨짐"})], # 모양 틀림 = 조합 없음 }, { "id": "s2", "type_id": "box", "name": "BOX", "facility": None, "chainage_m": 160.0, "slots": [_slot("s2", None, _item("SS1"), linked=True)], # 빈 칸 없음 = 이름만 }, ] def test_미지정_글과_조합_칸(): out = _run( f"\nconst f = {json.dumps(FACILITIES, ensure_ascii=False)};" "\nconst at = (s) => unlinkedAt(f, s);" "\nconsole.log(JSON.stringify({" " t100: unassignedText(at(100), '본체'), t160: unassignedText(at(160), '본체')," " t0: unassignedText(at(0), '본체')," " c100: [...unassignedCombos(at(100))], c160: [...unassignedCombos(at(160))] }));" ) assert out["t100"] == "배관: 본체 · 관 / 세월교: 유출 구조" assert out["t160"] == "BOX" and out["t0"] == "" assert out["c100"] == ["system||SS2"] # 연결된 칸 · 고른 조합 없는 칸은 뺌 assert out["c160"] == [] def test_화면_연결(): summary = (ROOT / "B08_Quantity/B08_Quantity_UI_Summary.ts").read_text(encoding="utf-8") assert ( 'unassignedText(at, L("B08_Quantity_Link_Body"))' in summary ) # 칸 이름 = 모달과 같은 규칙 assert ( 'key: "unassigned", label: missingHead' in summary and "frozen: hasMissing ? 2 : 1" in summary ) assert "...markOf(here[i])," in summary and "filter((id) => comboIds.has(id))" in summary assert '${L("B08_Quantity_Summary_Unlinked")}' in summary # 「· 미연결」 측점 표기 그대로 locale = (ROOT / "ui_template/ui_template_locale_b4.ts").read_text(encoding="utf-8") assert 'B08_Quantity_Summary_Unassigned: ["미지정", "Unassigned"]' in locale