Files
Aislo/resources/tester/test_356_b06_card_center.py
T
eomsangdonandClaude Opus 5.5 f44b12d62a fix(440 B06 카드 고르기 차례): 암 경계선 판정 = 구조물 판정면 아래 — 구조물 아랫부분 누름이 구조물을 고름
- 화면 실측(검증_sub7 · 노선 초안): 암 경계 판정이 벽 판정면 40 % · 관 판정면 23 % 를 덮음 → 0
- 시험: test_440 ④ · 356 배선 꼴

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TteK8mfYZetk5P3bEZkyVZ
2026-10-18 18:37:35 +09:00

93 lines
3.5 KiB
Python

"""356 B06 횡단 카드 — 키 강조 · 중심점(요구 235-17 · 18 · 260).
못박는 것
- 356-2 카드 초점 없음 — 마우스로 고른 뒤 키를 눌러도 초점 테두리(다른 색) 안 뜸 · ▲▼ 계획고는 창 듣개.
- 356-3 중심점 = 보라 선 고름 끝 조각(판정 원 · 노면 판정보다 위 · 다른 고름과 하나만) ·
▲▼ = 종단 계획고.
- 424 중심점 좌우 끔(요구 260) — ◀▶ 단추 없음 · ◀▶ 키는 먹어 막음 · 가로 끌기 없음 ·
노선 좌우 배선 걷음(좌우는 평면에서만).
진짜 TS 는 `helper_356_center.cjs` 가 Node 로 돌림.
"""
from __future__ import annotations
import json
import os
import subprocess
import sys
from pathlib import Path
import pytest
HERE = Path(__file__).resolve().parent
ROOT = Path(__file__).resolve().parents[2]
B06 = ROOT / "B06_Section"
if str(ROOT) not in sys.path:
sys.path.insert(0, str(ROOT))
from config.config_system import STANDARD_CROSS_SECTION # noqa: E402
pytestmark = pytest.mark.skipif(
not os.path.isdir(ROOT / "config" / "node_modules"),
reason="프론트엔드 의존성 미설치",
)
def test_카드_초점_없음():
view = (B06 / "B06_Section_UI_Cross_View.ts").read_text(encoding="utf-8")
assert "card.tabIndex" not in view
assert 'card.addEventListener("keydown"' not in view
assert 'card.addEventListener("click", () => onSelect(section.station_id));' in view
@pytest.fixture(scope="module")
def ts(tmp_path_factory) -> dict:
standard = tmp_path_factory.mktemp("std") / "standard.json"
standard.write_text(json.dumps(STANDARD_CROSS_SECTION), encoding="utf-8")
proc = subprocess.run( # noqa: S603 — 고정 실행 파일
["node", str(HERE / "helper_356_center.cjs"), str(standard)],
capture_output=True,
text=True,
encoding="utf-8",
timeout=60,
)
assert proc.returncode == 0, proc.stderr
return json.loads(proc.stdout)
def test_중심점_고름_끝_조각(ts):
assert ts["moves"] == {"center": True} # designLineMoves → 카드 고름 끝 조각
assert ts["count"] == 1 and ts["cx"] == ts["x0"] # 중심 십자 자리 원 하나
assert ts["active"] and ts["panelOpen"] and ts["title"] == "중심점"
def test_중심점_좌우_없음_위아래만(ts):
assert ts["slots"] == [] # ◀▶ · ↺ 단추 없음
assert "좌우 이동은 평면에서" in ts["value"]
assert ts["keys"] == {
"left": True,
"right": True,
"up": False,
"down": False,
} # ◀▶ 먹어 막음 · ▲▼ = 종단도
assert ts["dragListeners"] == 0 # 가로 끌기 없음
assert ts["changes"] == 0
assert ts["exports"] == ["CENTER_HIT_CLASS", "bindAxisDrag", "centerHit"] # 노선 좌우 창구 걷음
def test_배선_걷음():
order = (B06 / "B06_Section_UI_Cross_Pick_Order.ts").read_text(encoding="utf-8")
assert (
"layer.append(...rocks, ...surfaces, ...edges, ...lines, ...centers);" in order
) # 암 = 판정면 아래(440)
for gone in (
ROOT / "B05_Profile" / "B05_Profile_UI_RouteEdit_Shift.ts",
ROOT / "B05_Profile" / "logic" / "B05_Profile_RouteShift.ts",
):
assert not gone.exists()
edit = (ROOT / "B05_Profile" / "B05_Profile_UI_RouteEdit.ts").read_text(encoding="utf-8")
assert "bindRouteShift" not in edit
page = (ROOT / "A00_Common" / "design" / "design_page.ts").read_text(encoding="utf-8")
assert "setRouteShiftOpener" not in page