Files
Aislo/resources/tester/test_323_9_save_redraw.py
T
eomsangdonandClaude Opus 5.5 0dc6769d6b test(508-1d 빨강 가림 1/2): 낡은 가짜 모듈 넷 지금 코드에 맞춤 · 공용 불러오기로 · 낡은 기대 둘 맞춤
- 54_9 알약: 구조물 표 불러오기(322-1) 못 찾음 → makeLoader 기본 풀이
- 398_2 · 408: 곡선 판 가둠(505-3) ResizeObserver · 판 찾기 가짜 더함 → makeLoader
- 323_9: 라우터 draft 길 import.meta.glob(302-1) 가짜 · 옛 풀이 그대로 requireFor · 기대 = 노선 그대로 [저장] 가림막 없음(498-3 D1)
- test_app_settings: CAD 명령 153 → 154(488-3 IMPORT)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 17:43:27 +09:00

59 lines
2.1 KiB
Python

"""PLAN 323-9 ① — B06 [저장] 뒤 카드가 저장 전 서버 상태로 돌아가던 흠.
저장 도중 바뀜 신호(초안이 정본으로 나가며 비워짐)가 낡은 상세 캐시 · 빈 초안으로 다시 그렸고, 뒤처리는
캐시만 비우고 다시 안 그렸음 → 저장 도중엔 안 그림 · 뒤처리가 서버 새 상세로 한 번 그림.
Node 헬퍼 = `helper_323_9_save_redraw.cjs`(진짜 저장 차례 · 횡단 뒤처리 · 상세 캐시).
"""
from __future__ import annotations
import json
import subprocess
from pathlib import Path
import pytest
HERE = Path(__file__).parent
ROOT = HERE.parent.parent
pytestmark = pytest.mark.skipif(
not (ROOT / "config" / "node_modules").is_dir(), reason="프론트엔드 의존성 미설치"
)
@pytest.fixture(scope="module")
def out() -> dict:
run = subprocess.run(
["node", str(HERE / "helper_323_9_save_redraw.cjs")],
capture_output=True,
text=True,
encoding="utf-8",
timeout=120,
check=True,
)
return json.loads(run.stdout)
def test_after_save_cards_show_server_new_detail(out: dict) -> None:
assert out["ok"] is True
assert out["before"] == "옛 자리 4+5"
assert out["after"] == "새 자리 4+8 · 47+0"
def test_no_redraw_from_stale_cache_while_saving(out: dict) -> None:
assert out["savingSeen"] == [True, False] and out["savingIdle"] is False
# 저장 도중 신호는 건너뜀 · 뒤처리가 새로 한 번 받음 · 노선 그대로 [저장] = 가림막 없음(498-3 D1)
assert out["calls"] == [
"refresh:skip",
"cross:save",
"fetch:새 자리 4+8 · 47+0",
]
def test_cross_view_wires_guard_and_redraw() -> None:
view = (ROOT / "A00_Common" / "design" / "design_view_cross.ts").read_text("utf-8")
body = view[view.index("async function refreshDetailForStructures") :]
body = body[: body.index("loadSectionDetail")]
assert "++structuresRefreshSeq" in body and "savingDesign(projectId)" in body
assert "redraw: () => (host.visible() ? refreshDetailForStructures()" in view