openModal 은 안 씀 — 바깥 누름 · Esc 닫기 · 제목줄 단추 묶음 · 오른쪽 횡단 칸을 못 담음. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NPJGtfXo6GMbcpiboQC4uK
49 lines
1.7 KiB
Python
49 lines
1.7 KiB
Python
"""계획노선 편집 겉틀 = 공용 모달 조각(PLAN 127-1) — 배경 · 제목줄은 공용 클래스, 닫기 규칙은 그대로."""
|
|
|
|
from __future__ import annotations
|
|
|
|
import re
|
|
from pathlib import Path
|
|
|
|
ROOT = Path(__file__).resolve().parents[2]
|
|
PAGE = ROOT / "B05_Profile"
|
|
|
|
|
|
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_겉틀은_공용_모달_조각():
|
|
chrome = (PAGE / "B05_Profile_UI_RouteEdit_Chrome.ts").read_text(encoding="utf-8")
|
|
assert 'import "@ui/ui_template_modal.css";' in chrome
|
|
assert '"ui-modal__backdrop b05-routeedit"' in chrome
|
|
assert '<div class="ui-modal__top b05-routeedit__head">' in chrome
|
|
assert "<h3>계획노선 편집</h3>" in chrome
|
|
assert "<strong>계획노선 편집</strong>" not in chrome
|
|
# 시험 · 배선이 집는 자리는 남김
|
|
for hook in (
|
|
'data-act="apply"',
|
|
'data-act="cancel"',
|
|
"b05-routeedit__close",
|
|
"b05-routeedit__measure-close",
|
|
):
|
|
assert hook in chrome
|
|
|
|
|
|
def test_겹치는_CSS는_공용에_맡김():
|
|
css = (PAGE / "B05_Profile_UI_Style_RouteEdit.css").read_text(encoding="utf-8")
|
|
overlay = _block(css, ".b05-routeedit")
|
|
for prop in ("position:", "z-index:", "background:", "align-items:"):
|
|
assert prop not in overlay
|
|
head = _block(css, ".b05-routeedit__head")
|
|
for prop in ("display:", "align-items:", "gap:"):
|
|
assert prop not in head
|
|
|
|
|
|
def test_바깥_누름_Esc_로_안_닫힘():
|
|
main = (PAGE / "B05_Profile_UI_RouteEdit.ts").read_text(encoding="utf-8")
|
|
assert "openModal" not in main
|
|
assert "Escape" not in main
|