Files
Aislo/resources/tester/test_177_4_pavement_span_box.py
T
eomsangdonandClaude Opus 5.5 d35743870d fix(B06): 목록 고름도 늘 고름 기록 — 같은 카드 안 구조물도 오감 · 새로 고침 뒤 그 폼(231-2)
- 목록 · 알약 · 형상 고름은 노면공이 아니어도 그 구조물 id 를 고름 한 칸에 적음 · 측점 고름이 연 것은 측점만(189-1)
- 새 시험 test_231_2 · test_231_1 · test_177_4 기대값 맞춤

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01STqEqztUthVFBmEP18wBSz
2026-10-10 17:52:53 +09:00

76 lines
3.0 KiB
Python

# -*- coding: utf-8 -*-
"""177-4 B06 노면공 목록 · 알약 고름 = 범위 카드 전부 테두리(박스) · 카드 하나 안 고름.
못박는 것
- 노면공 고름 = 범위 안 카드 전부 `b06-cross-card--span`(다른 구간형과 같음) + 포장층 강조 그대로.
- 카드 하나 고르기(`--selected`) 없음 · 범위 첫 카드로 스크롤만 · 옛 고른 카드는 리스너 없이 풂(폼 · 알약 유지).
- 세션 고름은 노면공 + 스크롤한 카드 측점(B05 로 가도 그 노면공).
Node 헬퍼 `helper_165_pavement_flow.cjs`(진짜 SPN) 결과를 같이 씀. 화면은 사용자 확인.
"""
import json
import os
import re
import subprocess
import pytest
HERE = os.path.dirname(os.path.abspath(__file__))
ROOT = os.path.abspath(os.path.join(HERE, "..", ".."))
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 out():
proc = subprocess.run(
["node", os.path.join(HERE, "helper_165_pavement_flow.cjs")],
capture_output=True,
text=True,
encoding="utf-8",
timeout=60,
)
assert proc.returncode == 0, proc.stderr
return json.loads(proc.stdout)
def test_노면공_고름은_카드_안_고르고_스크롤만(out):
for step, reveal, layer, cards in (
("step1", "reveal1", "pave", 12),
("step4", "reveal4", "pave", 12),
("step6", "reveal6", "pave2", 6),
):
snap = out[step]
assert snap["card"] is None # --selected 0
assert snap["form"] == layer and snap["pill"] == layer # 폼 · 알약 유지
assert snap["paveCards"] == cards # 범위 카드 전부
assert out[reveal] in ("s40", "s100")
assert out["pick1"] == {"chainageM": 40, "structureId": "pave"}
def test_범위_카드_테두리는_노면공도():
view = _read("B06_Section", "B06_Section_UI_Section_View.ts")
assert 'card.classList.toggle("b06-cross-card--span", span);' in view
assert "highlightPavement(card, pave ? mark : undefined);" in view
def test_스크롤만_길은_리스너를_안_거침():
view = _read("B06_Section", "B06_Section_UI_Section_View.ts")
body = re.search(r"revealStation\(stationId\) \{(.*?)\n \},", view, re.S)
assert body, "revealStation 없음"
text = body.group(1)
assert "selectedStationId = null;" in text
assert "profile.showCard(null);" in text
assert 'revealCard(stationId, "smooth");' in text
assert "stationSelectListener" not in text # 폼을 닫지 않음
cross = _read("A00_Common", "design", "design_view_cross.ts")
assert "if (revealOnly) sectionView.revealStation(nearest.station_id);" in cross
panel = _read("B06_Section", "B06_Section_UI_Page_Structures_Panel.ts")
assert "const pave = !coverable(structure);" in panel
# 목록 고름은 노면공뿐 아니라 늘 고름 기록(231-2)
assert 'if (!openingAtStation) selectDesign(deps.projectId, at, { from: "b06" });' in panel