"""387-8 종단 판이 접혀도(그리기 낡음 판정 없음) 관 초안 둔 채 다시 열기 = 펼친 때 값 — 미리 뜬 측점 안 섞임. · 관 초안 자리 미리 뜬 횡단(서버가 저장 계획선 = 옛 계획고로 셈)이 묶음 cross 뒤에 얹히면 상세 가게가 묶음이 다 돈 뒤 화면 선 기준 낡음을 보고 cross 한 번 더(낡음 판정 = 가게 몫 · 원칙 4 — 보기가 숨어도 계산 · 판정은 돎) · 같은 낡음 = 한 번만 · 묶음이 아직 안 섬 · 노선 초안 = 안 부탁 ./venv/Scripts/python.exe -m pytest resources/tester/test_387_8_folded_profile.py -q """ from __future__ import annotations import json import subprocess from pathlib import Path import pytest ROOT = Path(__file__).resolve().parents[2] HELPER = Path(__file__).parent / "helper_387_8_folded_profile.cjs" @pytest.fixture(scope="module") def out() -> dict: done = subprocess.run( # noqa: S603 — 고정 실행 파일 ["node", str(HELPER)], cwd=str(ROOT), capture_output=True, text=True, encoding="utf-8" ) assert done.returncode == 0, done.stderr return json.loads(done.stdout) def test_접힌_종단_판_다시_열기_펼친_때와_같음(out: dict) -> None: assert out["folded"]["mixed"] == [] and out["expanded"]["mixed"] == [] assert out["folded"]["sum"] == out["expanded"]["sum"] assert (out["folded"]["crosses"], out["folded"]["forced"]) == (1, 1) def test_되풀이_없음(out: dict) -> None: assert out["again"] == {"crosses": 1, "forced": 1} # 다시 읽어도 더 안 부탁 assert out["unfixed"] == {"crosses": 1, "forced": 1} # 못 고친 낡음 = 한 번만 @pytest.mark.parametrize("case", ["notStarted", "routeDraft", "noDraft"]) def test_안_부탁(out: dict, case: str) -> None: assert (out[case]["crosses"], out[case]["forced"]) == (0, 0) def test_부르는_곳() -> None: store = (ROOT / "B06_Section/B06_Section_Section_Store.ts").read_text(encoding="utf-8") walls = store.split("async function withDraftWalls", 1)[1].split("\n}\n", 1)[0] assert "recrossSaved(projectId, keyOf(projectId, routeId), detail, routeId);" in walls body = store.split("function recrossSaved", 1)[1].split("\n}\n", 1)[0] assert "staleKeyAgainstScreen(detail, staleOf)" in body and "askedStale" in body # 종단 판 그리기는 기다림 표시만(다시 셈 부탁 없음 · 387-4) preview = (ROOT / "B05_Profile/B05_Profile_UI_Profile_Preview.ts").read_text(encoding="utf-8") assert "forceCross" not in preview