- 표 둘 = 표 부품(m01-master__grid = 일반표 · m01-logic__grid = 데이터표) · 페이지 CSS 는 폭 · 머리 고정 · 칸 상태만 - 손 모달 다섯(조달 찾기 · 요소 고르기 · 표 바꾸기 · 복사 시트 · 표 고르기) = 모달 부품 openModal - 알림 띠 · 막힘 까닭 = 띠 알림 · 태그 = 배지 · 알약 · × · 삭제 · 로직 키 = 단추 부품 · muted 세 벌 = 보조 글 · 빈 줄 = 빈 상태 - M02 가 빌린 M01 클래스(표 · muted · 고르기 창)도 같은 부품으로 · 죽은 CSS 걷음 · 지킴 시험 test_553_5_m01_m02 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
78 lines
3.2 KiB
Python
78 lines
3.2 KiB
Python
"""모달 위 고정 · 「더하기」 → 「추가」(PLAN 30-1) — 화면 판정은 ORCA.
|
|
|
|
· 찾기 있는 모달은 세로 가운데 대신 위에서 고정 거리(목록 길이가 바뀌어도 찾기 칸이 안 움직임)
|
|
· 보이는 글에 「더하기」 없음(주석 · 안쪽 명령 이름 `시트더하기` 는 뺌)
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
import re
|
|
import subprocess
|
|
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_공용_모달_위_고정():
|
|
css = _text("ui_template/ui_template_modal.css")
|
|
assert "align-items: flex-start;" in _block(css, ".ui-modal__backdrop")
|
|
modal = _block(css, ".ui-modal")
|
|
assert "max-height: var(--modal-max, 80vh);" in modal
|
|
assert "margin-top: calc((100dvh - var(--modal-max, 80vh)) / 2);" in modal
|
|
# 큰 창은 max-height 대신 --modal-max(위 거리가 함께 맞음)
|
|
# 고르기 창 = 공용 큰 창 곁값(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"
|
|
)
|
|
assert "margin-top: 0;" in _block(
|
|
_text("M02_MasterTemplete/M02_MasterTemplete_Drawing.css"), ".m02-pop > .ui-modal"
|
|
)
|
|
|
|
|
|
def test_따로_둔_모달도_위_고정():
|
|
# M01 고르기 · 복사 · 조달 창 = 모달 부품(553-5) — 위 고정은 공용 .ui-modal 이 냄
|
|
assert "--modal-max: 90vh;" in _block(
|
|
_text("M01_MasterData/M01_MasterData_UI_LogicLab_Style.css"), ".ui-modal.m01copy__sheet"
|
|
)
|
|
for rel in (
|
|
"M01_MasterData/M01_MasterData_UI_Pick.ts",
|
|
"M01_MasterData/M01_MasterData_UI_Logic_Pick.ts",
|
|
"M01_MasterData/M01_MasterData_UI_Logic_PickTable.ts",
|
|
"M01_MasterData/M01_MasterData_UI_LogicLab_Copy.ts",
|
|
):
|
|
src = _text(rel)
|
|
assert "openModal(" in src and "document.body.append(" not in src, rel
|
|
b01 = _text("B01_Dashboard/B01_Dashboard_UI_Style.css") + _text(
|
|
"B01_Dashboard/B01_Dashboard_UI_Style_Company.css"
|
|
)
|
|
assert "align-items: flex-start;" in _block(b01, ".b01-dashboard__modal")
|
|
|
|
|
|
def test_보이는_글에_더하기_없음():
|
|
files = subprocess.run(
|
|
["git", "ls-files", "*.ts"], cwd=ROOT, capture_output=True, text=True, encoding="utf-8"
|
|
).stdout.split()
|
|
left = []
|
|
for rel in files:
|
|
if rel.startswith(("tmp/", "docs/", "resources/")):
|
|
continue
|
|
for no, line in enumerate(_text(rel).splitlines(), 1):
|
|
if line.strip().startswith(("//", "*", "/*")):
|
|
continue
|
|
for m in re.finditer(r"([\"'`])((?:(?!\1).)*더하기(?:(?!\1).)*)\1", line):
|
|
if m.group(2) != "시트더하기": # 안쪽 명령 이름 — 화면에 안 나옴
|
|
left.append(f"{rel}:{no}: {m.group(2)}")
|
|
assert not left, left
|