diff --git a/M02_MasterTemplete/M02_MasterTemplete_Labor_Detail.ts b/M02_MasterTemplete/M02_MasterTemplete_Labor_Detail.ts index 24b45bd61..0e34d21ee 100644 --- a/M02_MasterTemplete/M02_MasterTemplete_Labor_Detail.ts +++ b/M02_MasterTemplete/M02_MasterTemplete_Labor_Detail.ts @@ -62,7 +62,7 @@ export interface LaborDetailOptions { /** 「면적산출에서 잇기」 — 그 열 면적산출 상세로(옮겨 가면 참 · 취소 = 거짓 · 없으면 단추 없음) */ goArea: GoArea | null; /** 구조물 조합 카드 갈래(43-4) — 단가산출 로직 표 + 자재목록만 · 위로 · 아래로 · 로직 추가 · - * 정보(단위 · 본뜬) · 다이어그램 없음 · 옵션 · 삭제 · 자재 추가 · 줄 · 수량 모달은 상세와 같음 */ + * 자재 추가 · 정보(단위 · 본뜬) · 다이어그램 없음 · 옵션 · 삭제 · 줄 · 수량 모달은 상세와 같음 */ card?: boolean; } @@ -434,7 +434,7 @@ export function mountLaborDetail( }), ]), section(tc("Logics_Title"), opt.card ? null : addLogic, logicHost), - section(tc("Labor_Mats"), addMat, matHost), + section(tc("Labor_Mats"), opt.card ? null : addMat, matHost), ...(opt.card ? [] : [dgBox]), ], }), diff --git a/resources/tester/test_m02_card_shell.py b/resources/tester/test_m02_card_shell.py index 7431f9b31..0cd36812d 100644 --- a/resources/tester/test_m02_card_shell.py +++ b/resources/tester/test_m02_card_shell.py @@ -80,6 +80,7 @@ def test_일위대가_카드는_상세_카드_갈래(): detail = _text("M02_MasterTemplete_Labor_Detail.ts") assert "...(opt.card ? {} : { move })" in detail # 순서 단추 없음 · 빼기는 그대로 assert "opt.card ? null : addLogic" in detail and "...(opt.card ? [] : [dgBox])," in detail + assert "opt.card ? null : addMat" in detail # 49-6 — 카드엔 [자재 추가] 없음 · 상세는 그대로 rows = _text("M02_MasterTemplete_Labor_Rows.ts") assert "const tools = !!(move || remove || option);" in rows and "compactTable" not in rows assert "compact" not in _text("M02_MasterTemplete_Labor_View.ts").split("*/", 1)[1] diff --git a/resources/tester/ui_checks/43-4_일위대가_카드.js b/resources/tester/ui_checks/43-4_일위대가_카드.js index bc992ab31..10c6db239 100644 --- a/resources/tester/ui_checks/43-4_일위대가_카드.js +++ b/resources/tester/ui_checks/43-4_일위대가_카드.js @@ -4,7 +4,7 @@ * 부르는 법: orca eval --expression "$(cat 이 파일)" (async 식 · JSON 글을 돌려줌 · 20초 안 — 길면 ORCA 가 끊음) * 기대 수치: * - sections = ["단가산출 로직", "자재목록"] · diagram = 0 · info = 0(단위 · 본뜬 칸 없음) - * - addLogic = 0 · up = down = 0 · remove = 로직 줄 수 · addMat = 1 · rows = 담은 로직 수(item1 = 14) + * - addLogic = 0 · up = down = 0 · remove = 로직 줄 수 · addMat = 0(49-6) · rows = 담은 로직 수(item1 = 14) * - money2 = true(금액 칸이 두 줄 — 위 기준 · 아래 반영) * - scroll.overflowX = "auto" · scroll.wide = 참(item1 표 ≈ 870px > 카드 ≈ 310px · 표 감싸개 안 가로 스크롤) * - rowModal = 「넣을 값 — …」 · qtyModal = 모달 뜸(수량 · 43-1) · 둘 다 닫기 뒤 dirty = false diff --git a/resources/tester/ui_checks/49-6_카드_자재추가_숨김.js b/resources/tester/ui_checks/49-6_카드_자재추가_숨김.js new file mode 100644 index 000000000..5cd5c7167 --- /dev/null +++ b/resources/tester/ui_checks/49-6_카드_자재추가_숨김.js @@ -0,0 +1,46 @@ +/* 49-6 — 구조물 조합 일위대가 카드엔 [자재 추가] 없음 · 일위대가 상세엔 그대로 + * 시작 화면: M02 마스터 템플릿 · 마스터 층(#/m02-master-template?open=구조물조합&root=master) · 시스템 관리자 · + * 나무에 item1(일위대가 담은 로직 있는 열)이 있음 + * 부르는 법: orca eval --expression "$(cat 이 파일)" (async 식 · JSON 글을 돌려줌) + * 기대 수치: card.addMat = 0 · card.addLogic = 0 · card.mats = 1(자재목록 구역은 있음) · detail.addMat = 1 + * 하는 일: 카드 읽기 → 카드 [수정] 상세 읽기(저장 안 함 · item1 다시 눌러 상세에서 나옴) + */ +(async () => { + const w = (ms) => new Promise((r) => setTimeout(r, ms)); + const until = async (fn, ms = 6000) => { + for (let t = 0; t < ms; t += 150) { + const v = fn(); + if (v) return v; + await w(150); + } + return null; + }; + const vis = (b) => b && !b.hidden && b.offsetParent !== null; + const count = (root, t) => + [...root.querySelectorAll("button")].filter((b) => vis(b) && b.textContent.trim() === t).length; + document.querySelector('[data-node="i|item1"]').click(); + const ed = await until(() => { + const e = document.querySelector(".m02-struct__labor .m02-labor__edit"); + return e && e.querySelector("tbody tr[data-labor-logic]") ? e : null; + }); + if (!ed) return JSON.stringify({ error: "카드 몸 없음" }); + const card = ed.closest(".m02-struct > *"); + const out = { + card: { + addMat: count(card, "자재 추가"), + addLogic: count(card, "로직 추가"), + mats: [...ed.querySelectorAll(".m01-logic__section-head h3")].filter( + (h) => h.textContent === "자재목록", + ).length, + }, + }; + // 일위대가 상세 = 카드 [수정] + [...card.querySelectorAll(".m02-struct__card-tools button")] + .find((b) => b.innerText.trim() === "수정") + ?.click(); + await until(() => document.querySelector(".ui-side-panels-row .m02-labor__edit")); + await w(300); + out.detail = { addMat: count(document, "자재 추가") }; + document.querySelector('[data-node="i|item1"]')?.click(); + return JSON.stringify(out); +})();