fix(472-6 6-B 저장 뒤 초안 되씀): 노선 저장 성공 뒤 묶음이 노선 초안 비움을 「버림」으로 보고 초안 전 관 · 구조물 초안을 세션에 되쓰던 흠 — 저장이면 초안 전 값 버림(commitRouteFacilities)

- 화면 검증(검증_sub8)에서 찾음 — 저장 뒤 옹벽 초안이 끌기 전 자리(600)로 남아 다음 [저장]이 옛 자리로 되돌릴 뻔함
- design_pipeline_page 네 줄(commit) · routeSaved 가 노선 초안 비우기 전에 부름 · 시험 test_472_6_route_save

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-19 12:34:38 +09:00
co-authored by Claude Opus 5.5
parent 4b6800e387
commit a3d24cf494
5 changed files with 26 additions and 3 deletions
@@ -36,6 +36,9 @@ const STUBS = {
currentRoute: () => "b05-profile",
remountRoute: () => calls.push("remount"),
},
"../A00_Common/design/design_pipeline_page": {
commitRouteFacilities: () => calls.push("commit"), // 저장 = 초안 전 관 · 구조물 버림(6-B)
},
"../B06_Section/B06_Section_Section_Store": {
invalidateSectionDetail: (_p, routeId) => calls.push(`invalidate:${routeId ?? "all"}`),
},
@@ -94,7 +94,7 @@ def test_추천_적용은_as_initial_저장_뒤_다시_세움(out):
assert body["as_initial"] is True and body["initial"] == {"mode": "earthwork"}
assert body["draft"]["nodes"] == [[1, 1], [9, 9]]
# 잠금 막 하나(472-6 6-B — 저장 직전 저장 관 떠 두기는 서버 한 본문 몫 · 추천은 초안을 비우니 안 받음)
assert out["recommendCalls"] == ["overlay:on", "replan", "overlay:off"]
assert out["recommendCalls"] == ["overlay:on", "replan", "commit", "overlay:off"] # 초안 전 시설 버림
assert out["recommendDraftsLeft"] == {"route": None, "pipes": None} # 새 초기값에서 다시
assert out["rebuilt"] == 1
+12
View File
@@ -378,3 +378,15 @@ def test_정상_한_본문은_옛_차례와_같음() -> None:
asyncio.run(undo())
files.discard()
assert _state(ROOT_DIR) == start
def test_저장한_노선_초안은_버림으로_되돌리지_않음() -> None:
"""화면 흠(6-B 화면 검증) — 저장 뒤 노선 초안 칸을 비우면 묶음이 「초안 버림」으로 보고 초안 전 관 ·
구조물 초안을 세션에 되써 다음 [저장]이 옛 자리로 되돌렸음 → 저장 성공이면 초안 전 값을 버림(commit)."""
apply = (ROOT / "B05_Profile" / "B05_Profile_UI_RouteEdit_Apply.ts").read_text(encoding="utf-8")
body = apply[apply.index("export function routeSaved") :]
body = body[: body.index("\n}\n")]
assert body.index("commitRouteFacilities(projectId);") < body.index('set("routeDraft", null)')
page = (ROOT / "A00_Common" / "design" / "design_pipeline_page.ts").read_text(encoding="utf-8")
assert "commit: () => void (beforeDraft = null)," in page
assert "if (!beforeDraft) return;" in page # 버린 차례 = 초안 전 값이 있을 때만 되씀