- B06 중심점 칸 = 버튼 없음 · 「▲▼ = 종단 계획고 · 좌우 이동은 평면에서」 · ◀▶ 키 먹어 막음 - B06_Section_UI_Cross_Center = 판정 원 · 한 축 끌기(암 경계선)만 남김 - B05 노선 좌우 host(_RouteEdit_Shift) · 고름 계산(logic/B05_Profile_RouteShift) 지움 · 페이지 · 편집기 배선 한 줄씩 걷음 - 시험 356 = 가짜 DOM 으로 중심점 고름 · 버튼 없음 · 키 · 끌기 없음 확인 · 356_4 = 중심점 좌우 걸음 뺌 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ji4nuyLVHcxrXWHTdb5nRD
91 lines
3.4 KiB
Python
91 lines
3.4 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(...surfaces, ...edges, ...lines, ...centers);" in order
|
|
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
|