# -*- coding: utf-8 -*- """B05 · B06 좌측 패널 아래 고정(계획서 44-3) — 단추 묶음이 패널 바닥에 붙고 위 칸만 스크롤. 공용 쪼개기(`splitSidebarActions`)가 [스크롤 칸][아래 고정 단추] 로 나누는데, 한 페이지(design_page)는 좌측 자리를 빈 채 틀에 넘겨 쪼개기가 지나가고, 보기 전환이 패널 클래스를 통째 덮어 `ui-sidebar-fill` 을 지웠다. 세 자리가 다시 어긋나면 빨강. 화면 수치는 `ui_checks/44-3_좌측패널_하단고정.js`. """ from pathlib import Path ROOT = Path(__file__).resolve().parents[2] OVERLAY = ROOT / "ui_template" / "ui_template_overlay.ts" PANEL = ROOT / "A00_Common" / "design" / "design_panel.ts" SHARED = ROOT / "A00_Common" / "design" / "design_shared.ts" def read(path: Path) -> str: return path.read_text(encoding="utf-8") def test_split_is_exported_and_idempotent(): src = read(OVERLAY) assert "export function splitSidebarActions(" in src assert 'if (body.classList.contains("ui-sidebar-split")) return;' in src def test_shared_panel_splits_after_attach(): src = read(SHARED) attach = src.index("shared.left.append(panel.root);") assert "splitSidebarActions(body)" in src[attach : attach + 400] def test_panel_keeps_fill_class_and_scroll_host(): src = read(PANEL) # 보기 전환이 클래스를 통째 덮으면 ui-sidebar-fill 이 지워져 단추 묶음이 바닥에서 뜬다. assert "root.className = next" not in src # 늦게 서는 칸은 스크롤 칸 안으로 — 패널 루트에 바로 끼우면 스크롤 밖에 남는다. assert ":scope > .ui-sidebar-scroll" in src