# -*- coding: utf-8 -*- """PLAN 294-1 · 294-2 — 선택 컨테이너 [삭제] 단추 · 물넘이 콘크리트 형상 고름 컨테이너. 294-1 B06 조정 강조(`setGroupLabel`)가 이름표 글 칸만 고침 — 강조 켜고 끈 뒤에도 [삭제] 단추 · 원래 글(「삭제」 안 섞임) · 괄호 붙임도 글 칸만. 294-2 물넘이포장 콘크리트 누름(side "pipe" · 배관 명세 숨음) = 「경사각도」 상자 강조 · 배관이면 「관」 상자 그대로. Node 가짜 DOM 위에서 `B06_Section_UI_Adjust_Dock.ts` 를 돌림(`helper_294_1_chute_remove_pick.cjs`). """ import json import subprocess from pathlib import Path import pytest HERE = Path(__file__).resolve().parent ROOT = HERE.parents[1] @pytest.fixture(scope="module") def out(): proc = subprocess.run( ["node", str(HERE / "helper_294_1_chute_remove_pick.cjs")], capture_output=True, text=True, encoding="utf-8", timeout=60, ) assert proc.returncode == 0, proc.stderr return json.loads(proc.stdout) def _box(text, buttons, active, base=None): return {"active": active, "text": text, "buttons": buttons, "base": base or text} def test_도수로_강조_켜도_삭제_단추_원래_글(out): assert out["chuteOn"] == _box("도수로/돌붙임", ["삭제"], True) def test_괄호_붙임도_글_칸만_단추_그대로(out): assert out["wingOn"] == _box("유출 날개벽 (기슭막이)", ["삭제"], True, "유출 날개벽") assert out["chuteOff"] == _box("도수로/돌붙임", ["삭제"], False) def test_물넘이_콘크리트_고름_경사각도_상자(out): assert out["slopeOn"] == _box("경사각도", [], True) assert out["pipeOn"] is False assert out["wingOff"] == _box("유출 날개벽", ["삭제"], False) def test_풀면_원래_글_단추_그대로(out): assert out["released"] == [ _box("도수로/돌붙임", ["삭제"], False), _box("유출 날개벽", ["삭제"], False), _box("경사각도", [], False), ] def test_배관이면_관_상자_그대로(out): assert out["pipeVisible"] == {"pipe": True, "slope": False} def test_형상_고름_길_그대로(): view = (ROOT / "B06_Section" / "B06_Section_UI_Cross_View.ts").read_text(encoding="utf-8") # 물넘이 콘크리트 · 맹암거 형상 누름 = 관 지점 고름 키 "pipe"(287-5) · 다시 누름 = 풂(toggle) assert 'shapePickRoute(svg, (at) => toggleRevet("pipe", at))' in view assert 'setShapeActive(key === "pipe");' in view