feat(560-4): 단계 이동 = 저장 뒤 이동 — mountGroupStep beforeLeave(단계 아이콘 · [<] [>] · 머리 메뉴 · 뒤로 한 길) · D02 바뀐 것 저장 · 첫 불러오기 실패에도 지도 · 옛 캐시가 서버 값 안 덮음
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
"""560-4 D 단계 이동 = 저장 뒤 이동 지킴 시험 — 서버 · 화면 없이 소스만 본다.
|
||||
단계 아이콘 · [<] [>] · 머리 메뉴 · 뒤로가 한 함수(beforeLeave)를 거치고 · D02 첫 불러오기 실패에도 지도를 세움."""
|
||||
|
||||
import re
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[2]
|
||||
|
||||
|
||||
def _src(path: str) -> str:
|
||||
return (ROOT / path).read_text(encoding="utf-8")
|
||||
|
||||
|
||||
def test_group_step_waits_before_leave():
|
||||
ts = _src("A00_Common/group_workflow.ts")
|
||||
assert "beforeLeave?: () => Promise<boolean>" in ts
|
||||
assert "setLeaveGuard(" in ts # 머리 메뉴 · 뒤로
|
||||
assert "leave().then((ok) => ok && navigateTo(" in ts # 단계 아이콘 · [<] [>]
|
||||
|
||||
|
||||
def test_d02_leave_saves_and_builds_map_on_fail():
|
||||
ts = _src("D02_PlanBase/D02_PlanBase_UI_Page.ts")
|
||||
assert "beforeLeave:" in ts and "ui-step-nav" not in ts # 따로 듣개 없음
|
||||
tail = ts[ts.rindex(" try {") :]
|
||||
# 불러오기 catch 뒤에 paint() — 실패해도 지도 · 표를 세움
|
||||
assert re.search(r"\} catch \(error\) \{[^}]*\}\s*active = firstEmpty\(\);\s*paint\(\);", tail)
|
||||
assert "sameBase" in ts # 옛 캐시는 그때 서버 값이 지금과 같을 때만
|
||||
Reference in New Issue
Block a user