- 그린 띠마다 투명 판정면(벽 · 관 판정면 아래 · 보라 선 위) · 고름 키 chute · 강조 setter - 좌측 「도수로/돌붙임」 상자 강조 · 스크롤 · 상자 고치면 띠 고름 · 자기 측점 폼으로 - 조정창 없음 · B05 3D chute 키 → B06 고름 · 새 시험 test_152_4_chute_pick - 받는 줄 문자열 시험 54-29 고침(152-2 OWN_HEIGHT_ROW) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01F3mdb91125mPoC6tpsQx4P
67 lines
2.6 KiB
Python
67 lines
2.6 KiB
Python
"""152-4 도수로 · 돌붙임 띠 고름 · 강조 — 118-1 관 고름 꼴(판정면 · setter · 좌측 상자 · 3D 키).
|
|
|
|
화면 TS 를 흉내 DOM 에서 돌린 값(`helper_152_4_chute_pick.cjs`) + 배선 문자열.
|
|
"""
|
|
|
|
import json
|
|
import subprocess
|
|
from pathlib import Path
|
|
|
|
import pytest
|
|
|
|
ROOT = Path(__file__).resolve().parents[2]
|
|
HELPER = Path(__file__).parent / "helper_152_4_chute_pick.cjs"
|
|
NODE_MODULES = ROOT / "config" / "node_modules"
|
|
|
|
pytestmark = pytest.mark.skipif(not NODE_MODULES.is_dir(), reason="프론트엔드 의존성 미설치")
|
|
|
|
|
|
@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 _src(relative: str) -> str:
|
|
return (ROOT / relative).read_text(encoding="utf-8")
|
|
|
|
|
|
def test_띠마다_판정면_벽_관_아래(out: dict) -> None:
|
|
overlay = out["overlay"]
|
|
assert overlay["bands"] == overlay["chuteHits"] == 2
|
|
assert overlay["sameShape"]
|
|
n = overlay["chuteHits"]
|
|
assert overlay["hitOrder"][:n] == ["chute"] * n # 벽 · 관 판정면이 위(겹치면 이김)
|
|
assert "chute" not in overlay["hitOrder"][n:]
|
|
|
|
|
|
def test_띠_누름_고름_강조(out: dict) -> None:
|
|
overlay = out["overlay"]
|
|
assert overlay["picked"] == ["chute"] and overlay["stopped"]
|
|
assert overlay["on"] == [True, True] and overlay["off"] == [False, False]
|
|
assert out["bare"] == {"hits": 0, "setter": "function"}
|
|
assert out["noChute"]
|
|
|
|
|
|
def test_조정창_없음_3D_키(out: dict) -> None:
|
|
assert out["panel"] == {"hidden": True, "side": "chute", "touched": []}
|
|
assert out["pick"] == [["revet", "chute"]]
|
|
|
|
|
|
def test_좌측_상자_강조_배선() -> None:
|
|
view = _src("B06_Section/B06_Section_UI_Cross_View.ts")
|
|
assert "attachChuteBandPick(" in view and 'toggleRevet("chute")' in view
|
|
assert 'setChuteActive(key === "chute");' in view
|
|
dock = _src("B06_Section/B06_Section_UI_Adjust_Dock.ts")
|
|
assert (
|
|
'fieldset[data-spec-container="chute_add"], fieldset[data-spec-container="chute"]' in dock
|
|
)
|
|
selection = _src("B06_Section/B06_Section_UI_Page_Structures_Selection.ts")
|
|
assert 'if (id === "chute_add" || id === "chute") return "chute";' in selection
|
|
assert 'const owner = key === "chute" ? chainageM : ownerChainageOf(chainageM);' in selection
|
|
css = _src("B06_Section/B06_Section_UI_Style_Cross_Areas.css")
|
|
assert ".b06-chart__culvert-pitching.is-active {" in css
|