- ProfileViewState.corridorPending(표시와 한 칸) · sections.setCorridorPending · 모달 onOpen(지형 선 뒤 · 그 사이 닫으면 안 부름) - 시험: test_345_4_corridor_worker 4(워커 = 주 스레드 · transfer 9/9 · 저장본 먼저) · test_345_2_3d_modal 5(닫힌 동안 짓기 0) · 관련 310 통과 · typecheck 내 파일 0 오류 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VmC34fsxxbweEG3RUjs3Mn
79 lines
2.9 KiB
Python
79 lines
2.9 KiB
Python
"""345-2 3D → 큰 모달 — 닫힌 동안 그리기 0 · 처음 열 때 지형 · 닫으면 숨긴 자리 · 버림은 떠날 때만.
|
|
|
|
Node 헬퍼 `helper_345_2_3d_modal.cjs` 가 모달 조각을 트랜스파일해 가짜 뷰어로 돌림 · 배선은 글로 봄.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
import json
|
|
import subprocess
|
|
from pathlib import Path
|
|
|
|
import pytest
|
|
|
|
HERE = Path(__file__).resolve().parent
|
|
ROOT = HERE.parents[1]
|
|
|
|
|
|
def _read(rel: str) -> str:
|
|
return (ROOT / rel).read_text(encoding="utf-8")
|
|
|
|
|
|
@pytest.fixture(scope="module")
|
|
def out() -> dict:
|
|
run = subprocess.run(
|
|
["node", str(HERE / "helper_345_2_3d_modal.cjs")],
|
|
capture_output=True,
|
|
text=True,
|
|
encoding="utf-8",
|
|
check=True,
|
|
)
|
|
return json.loads(run.stdout)
|
|
|
|
|
|
def test_닫힌_동안_그리기_0(out):
|
|
assert out["closedDraws"] == 0
|
|
assert out["inPark"] is True
|
|
assert out["afterCloseDraws"] == out["openDraws"] == 3
|
|
assert out["backInPark"] is True
|
|
assert out["disposedOnClose"] is False # 닫기는 멈춤만 · 문맥 살림
|
|
|
|
|
|
def test_처음_열_때_지형_한_번_로딩_원(out):
|
|
assert out["terrainBeforeOpen"] == 0
|
|
assert out["wide"] is True and out["inModal"] is True
|
|
assert out["spinnerWhileLoading"] is True and out["spinnerGone"] is True
|
|
assert out["terrainLoads"] == 1 # 다시 열어도 다시 안 올림
|
|
assert out["modalCount"] == 2 # 열린 동안 또 눌러도 하나
|
|
assert out["reopenDraws"] == 5
|
|
|
|
|
|
def test_열_때만_다시_짓기_닫힌_동안_0(out):
|
|
"""345-4 — 낡은 3D 길 모형은 모달을 열 때(지형이 선 뒤)만 다시 짓기를 부름 · 닫혀 있으면 안 부름."""
|
|
assert out["opensBeforeTerrain"] == 0
|
|
assert out["opensAfterTerrain"] == 1
|
|
assert out["opensWhileClosed"] == 1
|
|
assert out["opensAfterReopen"] == 2 # 다시 열 때 한 번(열린 동안 또 눌러도 하나)
|
|
assert out["closedBeforeTerrainOpens"] == 0
|
|
|
|
|
|
def test_떠날_때만_버림(out):
|
|
assert out["beforeCloseOk"] is True
|
|
assert out["closedOnDispose"] is True
|
|
assert out["disposed"] is True
|
|
assert out["runningAfterDispose"] is False
|
|
|
|
|
|
def test_배선_3D_상주_없음_죽은_길_지움():
|
|
view = _read("A00_Common/design/design_view_profile.ts")
|
|
assert "mainContent.append(viewer.root)" not in view
|
|
assert "view3d.modal.park" in view and "view3d.modal.button" in view
|
|
assert "dispose: view3d.modal.dispose" in view
|
|
assert "loadTerrain" not in view # 지형은 모달을 열 때
|
|
for gone in ("beginMoveSelected", "deleteSelected", "updateSelected", "panel.setSelected"):
|
|
assert gone not in view
|
|
assert "selected-point" not in _read("B05_Profile/B05_Profile_UI_Panel_Sections.ts")
|
|
assert not (ROOT / "B05_Profile/B05_Profile_UI_Panel_Route.ts").exists() # 345-3 칸째 지움
|
|
assert "beginMoveSelected" not in _read("B05_Profile/B05_Profile_UI_Viewer.ts")
|
|
assert len(view.splitlines()) <= 700
|