- design_save: 노선 초안이 없으면 saveOneBody — 차례마다 조각(본문 · 저장 뒤 정리) · 서버가 다 저장한 뒤에만 정리(초안 비움 · 화면 맞춤) · 실패 = 차례 이름째 「아무것도 저장 안 함」 · 되돌림 실패 = 「복구 확인 필요」 · 기다림 알림 - 조각 함수: 페이지 설정 · 관 · 구조물(보기 목록) · 추가 측점 · 계획고(한 벌 종단도) · 관 옵션 · 상단측 · 횡단(횡단 보기) — 옛 flush 함수는 노선 바뀐 저장 길에 그대로(조각을 써서 같은 본문) - 보기 몫 steps · cross → parts · crossPart · 노선 바뀐 저장 길은 옛 차례 그대로(6-B) - 옛 9 차례를 단언하던 시험 10 개를 한 본문 꼴로(옛 PUT 줄 → SAVE 줄 · 조각 정리 차례) · 위키 [저장] 표 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
48 lines
1.8 KiB
Python
48 lines
1.8 KiB
Python
"""PLAN 386-6 sub7 — [저장] 본문 보기 무관(B05 만 연 길 지움).
|
|
|
|
못박는 것
|
|
- [저장] · [확정] 둘 다 횡단 보기를 (숨긴 채라도) 세움 → 횡단 본문 = 횡단 보기 몫 한 벌(`crossSaveParts`).
|
|
- 종단 보기 몫엔 횡단 본문이 없음 — 옛 「횡단 보기를 세운 적 없이 [저장]」 캐시 패치 길(saveCachedCrossPatches) 지움.
|
|
- 횡단 보기를 못 세우면 반쪽 저장 대신 실패 알림.
|
|
화면(B05 만 연 [저장] 본문 = B06 다녀온 본문)은 PLAN 386-6 검증 줄.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
from pathlib import Path
|
|
|
|
ROOT = Path(__file__).resolve().parents[2]
|
|
|
|
|
|
def _read(rel: str) -> str:
|
|
return (ROOT / rel).read_text(encoding="utf-8")
|
|
|
|
|
|
def _save_body() -> str:
|
|
shared = _read("A00_Common/design/design_shared.ts")
|
|
start = shared.index("export async function saveSharedDesign")
|
|
return shared[start : shared.index("\n}\n", start)]
|
|
|
|
|
|
def test_저장도_횡단_보기를_세움():
|
|
body = _save_body()
|
|
assert 'await shared.ensureView("cross");' in body
|
|
assert 'if (confirm) await shared.ensureView("cross")' not in body
|
|
# 472-6 — 횡단 본문 = 횡단 보기 조각(`crossPart`) · 한 본문 창구에 실림
|
|
assert " crossPart," in body
|
|
assert "profileSave?.cross" not in body
|
|
|
|
|
|
def test_못_세우면_실패_알림():
|
|
body = _save_body()
|
|
assert "if (!crossPart) {" in body
|
|
assert '"B06_Profile_Save_Failed"' in body and '"B06_Profile_Confirm_Failed"' in body
|
|
|
|
|
|
def test_종단_보기_몫엔_횡단_본문_없음():
|
|
actions = _read("B05_Profile/B05_Profile_UI_Page_Actions.ts")
|
|
start = actions.index("export function profileSaveParts(")
|
|
parts = actions[start:]
|
|
assert "saveCachedCrossPatches" not in actions
|
|
assert "\n cross: " not in parts and "crossPart" not in parts
|