- 다시 셈(refreshCrossDesigns) 부르는 곳 = 묶음 cross 단계 하나(design_shared savedCross) - 종단 미리 셈 · B06 설계 맞춤 · 3D 업데이트 = pipelineCross · reconcilePagePipeline(▲ 한 번 = cross 한 번) - 입력 칸 밖 세션 고침(노견 · 소단 · 단면 유형 · 조정창)은 forceCross 로 같은 입력이어도 한 번 더 - 카드 그리기 · 횡단 보기 면적 쓰기 지움 · 다시 셈 창구가 면적을 늘 얹음(바뀐 측점만 알림) - 저장 안 한 조정창 값을 상세 가게가 읽을 때 얹음(새 Section_Adjusts · B05 만 열어도 같은 면적) - 새 test_384_4_cross_window · 옛 약속 시험 넷 새 약속으로 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014utrjfoW831Vc5wJUd13kL
70 lines
2.6 KiB
Python
70 lines
2.6 KiB
Python
"""PLAN 317-1 — B05 [3D 업데이트]가 낡은 횡단을 먼저 다시 셈(요구 213).
|
|
|
|
- 낡음 지문(`staleKey`) — 낡은 측점이 있으면 지문 · 모두 맞으면 ""
|
|
- 그릴 때 잰 낡음은 다시 셈을 직접 안 부름 — 계산 묶음 cross 한 곳이 셈(387-4 · ▲ 한 번 = cross 한 번)
|
|
- 그래프가 그릴 때 지문을 패널에 넘김 · 단추는 예상형상을 짓기 전에 묶음 차례(다시 셈)를 기다림
|
|
|
|
실제 TS 를 `helper_317_stale_preview.cjs` 가 Node 로 돌린다(다시 셈 창구는 흉내).
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
import json
|
|
import os
|
|
import subprocess
|
|
|
|
import pytest
|
|
|
|
HERE = os.path.dirname(__file__)
|
|
ROOT = os.path.join(HERE, "..", "..")
|
|
|
|
pytestmark = pytest.mark.skipif(
|
|
not os.path.isdir(os.path.join(ROOT, "config", "node_modules")),
|
|
reason="프론트엔드 의존성 미설치",
|
|
)
|
|
|
|
|
|
def _read(*parts: str) -> str:
|
|
with open(os.path.join(ROOT, *parts), encoding="utf-8") as handle:
|
|
return handle.read()
|
|
|
|
|
|
@pytest.fixture(scope="module")
|
|
def result() -> dict:
|
|
out = subprocess.run(
|
|
["node", os.path.join(HERE, "helper_317_stale_preview.cjs")],
|
|
capture_output=True,
|
|
text=True,
|
|
encoding="utf-8",
|
|
timeout=120,
|
|
check=True,
|
|
)
|
|
return json.loads(out.stdout)
|
|
|
|
|
|
def test_stale_key_marks_only_stale_sections(result: dict) -> None:
|
|
assert result["key_stale"].startswith("50:")
|
|
assert result["key_fresh"] == ""
|
|
|
|
|
|
def test_stale_key_never_refreshes_directly(result: dict) -> None:
|
|
# 낡음이 와도 미리 셈은 다시 셈 창구를 안 부름 — 묶음 cross 한 곳(387-4)
|
|
assert result["calls"] == [0, 0, 0, 0, 0]
|
|
|
|
|
|
def test_draw_and_button_wiring() -> None:
|
|
panel = _read("A00_Common", "design", "design_profile.ts")
|
|
# 노선 초안 동안(346-2 붙임)은 계산 묶음 cross 를 기다림 — 그 밖은 같은 낡음 한 번만 다시 셈
|
|
assert (
|
|
"crossPreview.scheduleIfStale(key, store === preview)" in panel
|
|
and "onStaleDesigns: (key) =>" in panel
|
|
)
|
|
render = _read("B05_Profile", "B05_Profile_UI_Profile_Render.ts")
|
|
# 다시 셈 뒤에도 남은 낡음은 기다림 끝 — 곡선은 그리고 그 측점만 표시(342-1)
|
|
assert 'const pending = ctx.onStaleDesigns?.(stale) ?? stale !== "";' in render
|
|
assert "pendingRecalc: pending," in render
|
|
corridor = _read("B05_Profile", "B05_Profile_UI_Corridor.ts")
|
|
body = corridor.split("export async function refreshCorridor", 1)[1].split("\n}\n", 1)[0]
|
|
assert "await reconcilePagePipeline(projectId)" in body
|
|
assert body.index("reconcilePagePipeline") < body.index("ensureCorridor")
|