Merge remote-tracking branch 'origin/sub_laptop_4' into sub_laptop_2

This commit is contained in:
2026-10-09 19:05:57 +09:00
19 changed files with 198 additions and 156 deletions
+2 -2
View File
@@ -184,11 +184,11 @@ def test_수량_글은_이은_칸_주소를_보임() -> None:
assert out.returncode == 0, out.stderr
got = json.loads(out.stdout)
# 수량산출 열(40-1) — 위 결과단위 기준 수량 · 아래 지금 수량 짧은 글
assert got[:7] == ["10 ㎡", "1 ㎥", "", "손 5 ㎥", "12.5(B6)", "빈 칸(B6)", "—"]
assert got[:7] == ["10 ㎡", "1 ㎥", "", "수기 5 ㎥", "12.5(B6)", "빈 칸(B6)", "—"]
assert got[7:] == [
"수량 20 ㎡(B6)", # 44-6 — 수량(칸 주소)
"수량 20 ㎡(면적산출 칸)",
"수량 손 입력 3 ㎡",
"수량 수기 입력 3 ㎡",
"수량 빈 칸(B6)", # 이은 칸이 비었음 = 수량 없음(39-8 ② · 서버 area_values 와 같음)
"",
]
@@ -0,0 +1,95 @@
"""공용 모달 머리 단추 · 큰 창 · M02 수량산출 창(PLAN 147) — 소스 검사 · 화면 판정은 사용자.
· 147-1 곁값 `actions`(머리 [닫기] 바로 왼쪽 · 넘긴 창만) · `wide`(96vw × 94vh · 몸만 스크롤)
· 147-2 연결창 단추 넷 → 머리 · 큰 창 · 글 묻는 창 [확인] 머리 · [취소] 없음
· 147-3 M02 입력 · 수량산출 · 참조 창 — 아래 단추 줄 없음 · [확인] 머리 · 읽기만이면 없음
· 147-4 「손 입력」 → 「수기 입력」 · 짧은 글 「손」 → 「수기」 · [면적산출에서 잇기] · goArea 없음
"""
from __future__ import annotations
import re
from pathlib import Path
ROOT = Path(__file__).resolve().parents[2]
def _text(rel: str) -> str:
return (ROOT / rel).read_text(encoding="utf-8")
def _block(css: str, selector: str) -> str:
found = re.search(rf"^{re.escape(selector)} \{{([^}}]*)\}}", css, re.M)
assert found, selector
return found.group(1)
def test_147_1_곁값_actions_wide():
ts = _text("ui_template/ui_template_modal.ts")
assert "actions?: HTMLElement[];" in ts
assert "wide?: boolean;" in ts
# 몸에서 만든 단추도 넣게 mount 셋째 인자 = 머리 자리
assert "opts.mount(body, close, actions);" in ts
# 단추가 있을 때만 [닫기] 바로 앞에 — 없으면 지금 꼴(h3 · [닫기])
assert "if (actions.childElementCount) closeButton.before(actions);" in ts
assert 'children: [el("h3", { text: opts.title }), closeButton]' in ts
assert '"ui-modal--wide "' in ts
def test_147_1_머리_자리_큰_창_css():
css = _text("ui_template/ui_template_modal.css")
assert "margin-right: auto;" in _block(css, ".ui-modal__top > h3")
assert "justify-content: space-between;" in _block(css, ".ui-modal__top")
wide = _block(css, ".ui-modal.ui-modal--wide")
for rule in ("width: 96vw;", "height: 94vh;", "--modal-max: 94vh;", "overflow: hidden;"):
assert rule in wide, rule
body = _block(css, ".ui-modal--wide > .ui-modal__body")
assert "overflow: auto;" in body and "min-height: 0;" in body
def test_147_2_연결창_머리_단추_큰_창():
ts = _text("ui_template/ui_template_item_picker.ts")
assert "children: [copyButton, manageButton, clearButton, applyButton]," in ts
assert "actions: [headButtons]," in ts and "wide: true," in ts
# 편집 화면 = 머리 단추도 숨김(편집 중 [적용] 막음) · 돌아오면 다시
assert "headButtons.hidden = true;" in ts and "headButtons.hidden = false;" in ts
# 안내 글(구조물 [저장]) 은 아래 남김
assert "ui-item-picker__saveline" in ts
css = _text("ui_template/ui_template_item_picker.css")
assert ".ui-item-picker .ui-modal__actions[hidden]" in css
assert "width: min(1320px, 96vw);" not in css
def test_147_2_글_묻는_창_확인만_머리():
ask = _text("ui_template/ui_template_item_picker_ask.ts")
assert "head.append(createButton({ label: opts.okLabel" in ask
assert "cancelLabel" not in ask
for rel in (
"ui_template/ui_template_item_picker.ts",
"ui_template/ui_template_item_picker_detail.ts",
):
assert "cancelLabel" not in _text(rel), rel
def test_147_3_m02_창_셋_머리_확인():
m02 = "M02_MasterTemplete/M02_MasterTemplete_"
for name in ("Labor_Input", "Labor_QtyModal", "Labor_RefEdit"):
ts = _text(f"{m02}{name}.ts")
assert "m02-labin__foot" not in ts, name
assert "mount: (body, " in ts and ", head) => {" in ts, name
# 읽기만 = 머리 [닫기]만
assert "if (!opt.readOnly)" in ts and "head.append(" in ts, name
assert "In_Cancel" not in _text(f"{m02}Labor_Text.ts")
assert ".m02-labin__foot" not in _text(f"{m02}Labor.css")
def test_147_4_수기_입력_잇기_없음():
m02 = ROOT / "M02_MasterTemplete"
text = _text("M02_MasterTemplete/M02_MasterTemplete_Labor_Text.ts")
assert 'In_QtyHand: ["수기 입력", "Manual"],' in text
assert 'Labor_Hand: ["수기", "Manual"],' in text
assert "In_QtyGoArea" not in text
assert "손 입력" not in _text("M02_MasterTemplete/M02_MasterTemplete_CardHelp.ts")
for path in m02.glob("*.ts"):
src = path.read_text(encoding="utf-8")
assert "goArea" not in src and "GoArea" not in src, path.name
@@ -30,9 +30,9 @@ def test_공용_모달_위_고정():
assert "max-height: var(--modal-max, 80vh);" in modal
assert "margin-top: calc((100vh - var(--modal-max, 80vh)) / 2);" in modal
# 큰 창은 max-height 대신 --modal-max(위 거리가 함께 맞음)
assert "--modal-max: 94vh;" in _block(
_text("ui_template/ui_template_item_picker.css"), ".ui-modal.ui-item-picker"
)
# 고르기 창 = 공용 큰 창 곁값(147-2)
assert "--modal-max: 94vh;" in _block(css, ".ui-modal.ui-modal--wide")
assert "wide: true," in _text("ui_template/ui_template_item_picker.ts")
assert "--modal-max: 92vh;" in _block(
_text("B05_Profile/B05_Profile_UI_Style_RouteRecommend.css"), ".ui-modal.b05-routerec"
)