Files
Aislo/resources/tester/test_246_1_b09_bill_menu_simple.py
T
eomsangdonandClaude Opus 5.5 8d50aa0582 feat(B09): 설계내역서 입력 칸 테두리 되돌림 · 우클릭 「항목 추가」 하나 · 연결 이름 셋 · 「줄 삭제」 · 하위 메뉴 옆 판 (246-1 · 246-2)
- 공용 표 입력 칸 = 241 앞 모양(accent 5% 채움 · td is-can-edit 표시 지움 · 더블클릭 입력 그대로)
- 우클릭 더함 넷 → 「항목 추가」 — 항목 = 바로 아래 같은 부모 · 폴더 = 첫 하위 · 1단 = ← 내어쓰기(직접비 · 관급자재대 앞 · 자재 줄 막음)
- 연결 이름 = 구조물 조합 · 일위대가 사전조합 · 단가산출 · 들여오기 알림 글 쉬운 말 · 「줄 지우기」 → 「줄 삭제」 · 안내 글
- 공용 우클릭 메뉴 children = 「글 ▸」 한 줄 + 오른쪽 옆 판(올림 · 누름 · → 열기 · ← 닫기 · 화면 끝 = 왼쪽)
- 시험 기대값 고침(241_1 · 243_1 · 166_2 · 182 · 184_3 · 204_2) · 새 시험 246_1 · 246_2

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SE9MxeXTu2uaDZ55BJowAY
2026-10-10 21:28:09 +09:00

83 lines
4.9 KiB
Python

"""246-1 · 128 — B09 설계내역서 우클릭 메뉴 줄임 · 입력 칸 테두리 되돌림.
- 입력 칸 = 241 앞 모양(글 상자 accent 5% 채움 · td 표시 없음)
- 더함 = 「항목 추가」 하나 — 항목 = 바로 아래 같은 부모 · 폴더 = 그 폴더 첫 하위
- 맨 위 1단(새 공종) = ← 내어쓰기 — 직접비 · 손 줄은 묶음 · 관급자재대 앞 · 자재 줄은 못 냄
- 연결 이름 = 「구조물 조합」 · 「일위대가 사전조합」 · 「단가산출」 · 지움 = 「줄 삭제」
"""
import sys
from pathlib import Path
sys.path.insert(0, str(Path(__file__).resolve().parent))
from test_184_3_b09_bill_menu import DG, ROWS, _menu, _order, _row # noqa: E402
ROOT = Path(__file__).resolve().parents[2]
OLD_ADDS = ["위에 줄 추가", "아래에 줄 추가", "아래에 하위 줄 추가", "새 공종 추가(1단)"]
def test_입력_칸_테두리_없음():
css = (ROOT / "ui_template" / "ui_template_data_table.css").read_text("utf-8")
body = css.split(".ui-data-table__input {")[1].split("}")[0]
assert "background: color-mix(in srgb, var(--color-accent) 5%, var(--color-canvas));" in body
assert "box-shadow" not in body and "is-can-edit" not in css
def test_더함_하나_줄_삭제_연결_이름_셋():
keys = ["sec:1", "earth:4", "hand:g", "hand:a", "fee", "sec:G"]
out = _menu({}, labels=keys)["labels"]
for key in keys:
assert [x for x in out[key] if "추가" in x] == ["항목 추가"], key
assert not set(OLD_ADDS) & set(out[key]) and "줄 지우기" not in out[key]
assert "줄 삭제" in out["earth:4"] and "줄 삭제" in out["hand:a"]
link = (ROOT / "B09_Estimation" / "B09_Estimation_UI_Tabs_Bill_Link.ts").read_text("utf-8")
picks = link.split("const picks: Leaf[] = [")[1].split("];")[0]
for name in ["일위대가 호표", "단가산출 호표", "구조물 조합", "일위대가 사전조합", "단가산출"]:
assert f'["{name}",' in picks
for word in ["서고", "마스터", "회사", "개인", "M01", "새 산근", "로직"]:
assert word not in picks
toasts = [part.split(",")[0] for part in link.split("showToast(")[1:]]
assert toasts and not any("서고" in t for t in toasts) # 알림 글 쉬운 말
bill = (ROOT / "B09_Estimation" / "B09_Estimation_UI_Tabs_Bill.ts").read_text("utf-8")
assert "항목 추가 · 줄 삭제" in bill # 표 아래 안내 글
#: 관급자재대 안 손 묶음(hand:s · 자재 없음) · 손 항목(hand:t)
SUPPLY = [*ROWS[:-1], _row("hand:s", "sec:G", 2, "group", cost="supply"),
_row("hand:t", "hand:s", 3, cost="supply", qty=1, ref=DG), ROWS[-1]] # fmt: skip
def test_자리_규칙():
runs = [("hand:g", "항목 추가"), ("hand:a", "항목 추가"), ("hand:b", "항목 추가"),
("hand:a", "내어쓰기 ←"), ("hand:g", "내어쓰기 ←"), ("hand:s", "내어쓰기 ←"),
("hand:t", "내어쓰기 ←"), ("mat:M1", "내어쓰기 ←")] # fmt: skip
out = _menu({}, runs=runs, rows=SUPPLY)["runs"]
new = lambda b: [(e.get("parent"), e.get("name", e["key"])) for e in b["rows"]] # noqa: E731
# 폴더 = 그 폴더 첫 하위 · 항목 = 바로 아래 같은 부모
got = new(out["hand:g|항목 추가"])
assert got[got.index(("sec:1.2", "hand:g")) + 1] == ("hand:g", "새 줄")
got = [e["key"] for e in out["hand:a|항목 추가"]["rows"]]
row = out["hand:a|항목 추가"]["rows"][got.index("hand:a") + 1]
assert (row["name"], row["parent"]) == ("새 줄", "hand:g")
got = out["hand:b|항목 추가"]["rows"]
row = got[[e["key"] for e in got].index("hand:b") + 1]
assert (row["name"], row["parent"], "kind" in row) == ("새 줄", "sec:1.2", False)
# ← = 한 단씩 — 레벨 4 → 3(sec:1.2 아래) · 레벨 3 → 2(sec:1 아래)
assert ("hand:a", "sec:1.2") in _order(out["hand:a|내어쓰기 ←"])
assert ("hand:g", "sec:1") in _order(out["hand:g|내어쓰기 ←"])
# 관급 안 손 묶음 ← = 새 공종(직접비) · 관급자재대 앞
b = out["hand:s|내어쓰기 ←"]
tops = [k for k, p in _order(b) if p is None]
assert tops == ["sec:1", "sec:4", "hand:s", "sec:G"]
s = {e["key"]: e for e in b["rows"]}["hand:s"]
assert (s["kind"], s["cost"]) == ("group", "direct")
# 손 항목 ← 관급 묶음 밖(sec:G 아래) · 자재 줄 = 1단 안 됨
assert ("hand:t", "sec:G") in _order(out["hand:t|내어쓰기 ←"])
assert out["mat:M1|내어쓰기 ←"] is None
# 1단 손 항목 → 묶음(수량 · 연결 지움) — 2단 손 항목을 두 번 냄
one = _menu({"bill": out["hand:t|내어쓰기 ←"]}, runs=[("hand:t", "내어쓰기 ←")],
rows=SUPPLY)["runs"]["hand:t|내어쓰기 ←"] # fmt: skip
t = {e["key"]: e for e in one["rows"]}["hand:t"]
assert ("parent" in t, t["kind"], t["qty"], t["ref"], t["cost"]) == (
False, "group", None, None, "direct") # fmt: skip