"""282 B05 · B06 아래 종단 패널 도구줄 — [배수유역도] 단추 지움 · [새 창] = [초기화] 왼쪽(요구 177). - 282-1 [배수유역도] 켬끔 단추 · 켬끔 값(`drainage-visible`) 없음 · 옛 값 false 여도 판 · 손잡이 보임 - 282-2 [새 창] = 도구 묶음 맨 앞([초기화] 바로 왼쪽) · 다시 그려도 그 자리 · 열림 · 닫힘 동작 그대로 - 285-1 단추 글 = [창 분할] · 열린 동안 [창 결합](요구 179-2) `helper_282_1_profile_toolbar.cjs` 가 진짜 TS 를 가짜 DOM 위에서 돌림. """ import json import os import subprocess from pathlib import Path import pytest ROOT = Path(__file__).resolve().parents[2] HERE = os.path.dirname(os.path.abspath(__file__)) TOOLS = ["초기화", "↶", "↷", "직선화", "자유지정", "쉬프트", "▲", "▼"] @pytest.fixture(scope="module") def out(): proc = subprocess.run( ["node", os.path.join(HERE, "helper_282_1_profile_toolbar.cjs")], capture_output=True, text=True, encoding="utf-8", timeout=60, ) assert proc.returncode == 0, proc.stderr return json.loads(proc.stdout) def test_배수유역도_단추_코드_없음(): for rel in ( "B05_Profile/B05_Profile_UI_Drainage_Side.ts", "B05_Profile/B05_Profile_UI_Profile_SideTool.ts", "A00_Common/design/design_profile.ts", "A00_Common/design/design_shared.ts", "A00_Common/design/design_profile_popout.ts", "A00_Common/b_page_state.ts", "B05_Profile/B05_Profile_UI_Style_Table.css", ): src = (ROOT / rel).read_text(encoding="utf-8") for gone in ( "createDrainageToggleButton", "b05-drainage__toggle", "drainage-visible", "sideTool", ): assert gone not in src, (rel, gone) def test_새_창_초기화_바로_앞_다시_그려도(out): assert out["first"] == ["창 분할", *TOOLS] assert out["again"] == ["창 분할", *TOOLS] assert "b05-route-profile__popout" in out["buttonClass"] def test_새_창_열림_닫힘(out): assert out["opened"] == {"text": "창 결합", "inPopup": True} assert out["openedRender"] == ["창 결합", *TOOLS] assert out["closed"] == {"text": "창 분할", "inSlot": True, "popupClosed": True} assert out["closedRender"] == ["창 분할", *TOOLS] def test_옛_값_false_여도_판_손잡이_보임(out): assert out["side"] == {"rootHidden": False, "handleHidden": False, "hasSetVisible": False}