- design_save 차례 = 노선 → 관 → 구조물 → 계획고(옛 노선 칸 → 새 노선) → 암거 옵션 → 상단측 → 횡단(carryStationDrafts 뒤 저장) · 잠금 막 = [저장] 하나 · 실패 = 멈춤 · 초안 그대로 · 오류 한 줄 - [확정] 중 노선이 바뀌면 노선만 저장하고 다시 세움(새 노선으로 다시 [확정]) - _RouteEdit_Apply = 노선 저장 이음(편집기 등록부 · pendingRouteSave · saveRouteDraft · carryAfterRouteSave · routeSaveSummary · rebuildAfterRouteSave) · 단추 듣기 없음 - 결과 한 줄 = 관 지킴 · 새 교차 관 · 오목 보충 · 구조물 옮김 · 멀어짐 · 노선 밖 고침(서버 cross_dropped + 화면) · 배수유역 낡음 - RE_Chrome [노선 반영] 지움 · [반영 전으로] → [저장 전으로] · replanRoute 본문 = RouteSaveBody - 시험: test_design_store_save 차례 넷 더함 · 꼴 시험 셋 고쳐 씀 · 323_9 대역 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VmC34fsxxbweEG3RUjs3Mn
77 lines
3.6 KiB
Python
77 lines
3.6 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
|
|
# 346-3 — [노선 반영] 없앰(노선은 페이지 [저장]이 맨 앞에서 보냄) · [취소] = [저장 전으로]
|
|
assert ">저장 전으로</button>" in chrome and 'data-act="apply"' not in chrome
|
|
assert "노선 반영</button>" not in chrome
|
|
assert ">취소</button>" not in chrome and ">확인</button>" not in chrome
|
|
# 시험 · 배선이 집는 자리는 남김
|
|
for hook in ('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]
|