"""PLAN 723 — M02 일위대가(사전조합) 일위대가표만 · 줄 모달(내역 16 · 17). 723-1 서버 — 구조물 조합 알약에 안 줄 알약 (안 줄 수량 저장은 742-1 이 되살림 · `test_742_1_sc_qty_saved`). 723-2 · 723-3 화면 — 서고 상세 = `Labor_Table`(우클릭) · 줄 모달 = 717-2b 상세 줄 모드. """ import os from M02_MasterTemplete import M02_Labor_Doc as labor from M02_MasterTemplete import M02_Labor_Ref as refs from M02_MasterTemplete import M02_MasterTemplete_Store as store from resources.tester.test_m02_labor_ref import world # noqa: F401 — 임시 층 fixture SRC = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "..", "M02_MasterTemplete") SYS = {"층": "system", "주인": None} STONE = "GF000219" # 원/㎡ RATE = {"이름": "공구손료", "단위": "%", "단가": {"노무비": 0, "재료비": 0, "경비": 0}} def _src(name: str) -> str: return open(os.path.join(SRC, name), encoding="utf-8").read() def test_구조물_조합_알약에_안_줄_알약(world): # noqa: F811 with store.at(world["system"]): key = refs.create( "precombo", {"이름": "옹벽", "단위": "m", "담은로직": [{"로직": STONE, "별칭": "돌"}]} )["이름"] doc = labor.clean({"열": "rv", "담은로직": [{"참조": {**SYS, "키": key}}]}) pills = labor.pills(doc) rid = refs.ref_id({**SYS, "키": key}) assert [p["키"] for p in pills] == [rid, f"{rid}#0"] assert pills[1]["이름"] == "옹벽 · 돌" and pills[1]["단위"] == "㎡" def test_화면_서고_상세는_일위대가표만(): table, detail = ( _src("M02_MasterTemplete_Labor_Table.ts"), _src("M02_MasterTemplete_Labor_Detail.ts"), ) assert 'if (opt.mode === "precombo") return mountLaborTable(host, doc, opt);' in detail assert "calc = settle(calc, cur, {});" in table # 짝 셈 바로(742-1 수량 = 문서) assert 'const out: Record = { ...cur, 종류: "사전조합" };' in table for label in ('tc("Up")', 'tc("Down")', 't("Alias")', 'tc("Remove")'): assert label in table # 우클릭 메뉴 assert "fixed: (fx: LaborFixed, name: string)" in table # 721-2 고정 줄 이음 def test_화면_줄_모달은_SK_상세_줄_모드_적용은_덮개와_옵션(): modal, sk = ( _src("M02_MasterTemplete_Labor_RowModal.ts"), _src("M02_MasterTemplete_Labor_RowSk.ts"), ) detail = _src("M02_MasterTemplete_Sangeun_Detail.ts") assert "mountSangeunDetail(box, doc," in sk and "getValues: () => ({ ...values })" in detail assert "if (got.patch) row.패치 = got.patch;" in modal and "setValues(got.values);" in modal assert 'createCheckbox(t("AlsoSk"), { checked: false })' in modal # 기본 꺼짐 assert "openRowSangeun" not in modal # 717-3 두 보기 갈음