- mountRouteEditor(parent, host, …) — 덮개 · 전체 화면 · 닫기 걷음 · 이력 · 키 듣기 = host 보임 · 숨김 · 떠남 · 칸 크기 = ResizeObserver - [취소] → [반영 전으로](이력 처음으로 · 되돌리기로 다시 살림) · [확인] → [노선 반영] · 대기 막 = 화면 전체(노선 재탐색) - [노선 반영] 끝 = 초안 · 결과 · 옛 노선 · 종단면 캐시 비움 → remountRoute(location.reload 없앰) - R 라벨 = 칸 안 절대 위치 · 오른쪽 횡단 미리보기 = 접는 칸 · [3D] 단추 = 평면 머리 도구줄 - 새 _RouteEdit_UndoOwner(누른 판 기억) · 종단도 Ctrl+Z 줄이 물음 - 시험: test_345_3_route_body 5 · 칸 · 겉틀 시험 고쳐 씀 · 관련 411 통과(옛 3 실패 그대로) · typecheck 통과 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VmC34fsxxbweEG3RUjs3Mn
75 lines
3.4 KiB
Python
75 lines
3.4 KiB
Python
"""계획노선 편집 겉틀 — 345-3 부터 모달이 아니라 종단 보기 가운데 위 본문(PLAN 127-1 의 공용 모달 조각은 걷음).
|
|
|
|
· 덮개(`ui-modal__backdrop`) · 전체 화면 · 닫기 단추 없음 · 부모를 받아 붙음(`document.body` 아님)
|
|
· [취소] → [반영 전으로](이력 처음으로) · [확인] → [노선 반영] · 머리 끝 `tools` 자리([3D])
|
|
· 오른쪽 횡단 미리보기 = 접는 칸 · 재계산 대기 막은 화면 전체(fixed) · R 라벨은 칸 안 절대 위치
|
|
· 바깥 누름 · Esc 로 안 닫힘(모달 아님)
|
|
"""
|
|
|
|
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 _read(name: str) -> str:
|
|
return (PAGE / name).read_text(encoding="utf-8")
|
|
|
|
|
|
def test_겉틀은_본문_칸():
|
|
chrome = _read("B05_Profile_UI_RouteEdit_Chrome.ts")
|
|
assert "ui-modal" not in chrome
|
|
assert "document.body.append" not in chrome
|
|
assert "parent.append(overlay);" in chrome
|
|
assert 'overlay.className = "b05-routeedit";' in chrome
|
|
assert "b05-routeedit__close" not in chrome and 'data-slot="close"' not in chrome
|
|
assert '"tools"' in chrome and "replaceWith(...tools)" in chrome
|
|
assert ">반영 전으로</button>" in chrome and ">노선 반영</button>" in chrome
|
|
assert ">취소</button>" not in chrome and ">확인</button>" not in chrome
|
|
# 시험 · 배선이 집는 자리는 남김
|
|
for hook in ('data-act="apply"', 'data-act="cancel"', "b05-routeedit__measure-close"):
|
|
assert hook in chrome
|
|
assert 'data-act="side-toggle"' in chrome and "is-collapsed" in chrome
|
|
|
|
|
|
def test_CSS_덮개_걷음_대기막은_전체():
|
|
css = _read("B05_Profile_UI_Style_RouteEdit.css")
|
|
root = _block(css, ".b05-routeedit")
|
|
assert "position: relative;" in root and "flex: 1 1 auto;" in root
|
|
assert "z-index" not in root and "background" not in root
|
|
busy = _block(css, ".b05-routeedit__busy")
|
|
assert "position: fixed;" in busy and "z-index: var(--z-modal, 1000);" in busy
|
|
label = _block(css, ".b05-routeedit__label")
|
|
assert "position: absolute;" in label and "position: fixed" not in label
|
|
assert "display: none;" in _block(
|
|
css, ".b05-routeedit__side-wrap.is-collapsed > .b05-routeedit__side"
|
|
)
|
|
assert "@media (width < 1500px)" not in css # 접기는 단추로(처음만 폭으로)
|
|
|
|
|
|
def test_페이지_수명_닫기_없음():
|
|
main = _read("B05_Profile_UI_RouteEdit.ts")
|
|
assert "openModal" not in main and "Escape" not in main
|
|
assert "openRouteEditModal" not in main
|
|
assert "export async function mountRouteEditor(" in main
|
|
assert 'window.addEventListener("resize"' not in main # 칸 크기는 ResizeObserver
|
|
assert "new ResizeObserver(" in main
|
|
assert "host.onDispose(dispose);" in main
|
|
assert "historyControls.listen(host.visible());" in main
|
|
assert "history?.reset();" in main # [반영 전으로]
|
|
assert len(main.splitlines()) <= 700
|
|
label = _read("B05_Profile_UI_RouteEdit_Label.ts")
|
|
assert "document.body.append" not in label and "container.append(root);" in label
|
|
assert "container: overlay," in main
|
|
apply = _read("B05_Profile_UI_RouteEdit_Apply.ts")
|
|
assert "close" not in apply.split("export function bindRouteApply", 1)[1]
|