Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018jonfdxn1Xit9bdkNJpE4G
63 lines
2.2 KiB
Python
63 lines
2.2 KiB
Python
# -*- coding: utf-8 -*-
|
|
"""PLAN 173-2 — 고르기 모달 왼쪽 나무 = M02 마스터 나무 꼴.
|
|
|
|
자료 쪽(잎 글 · 폴더 먼저 · 툴팁)은 Node 시험(`ui/item-picker-data.test.ts`)으로,
|
|
층 단추 셋 · 뿌리 줄 없음 · 빈 자리 메뉴 · 폭 320px 은 소스로 본다.
|
|
"""
|
|
|
|
import os
|
|
import subprocess
|
|
|
|
ROOT = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
|
UI = os.path.join(ROOT, "ui_template")
|
|
|
|
|
|
def _text(name: str) -> str:
|
|
return open(os.path.join(UI, name), encoding="utf-8").read()
|
|
|
|
|
|
def test_자료_시험_통과_잎_글_폴더_먼저():
|
|
proc = subprocess.run(
|
|
[
|
|
"node",
|
|
"--experimental-strip-types",
|
|
os.path.join(ROOT, "resources", "tester", "ui", "item-picker-data.test.ts"),
|
|
],
|
|
capture_output=True,
|
|
text=True,
|
|
encoding="utf-8",
|
|
timeout=60,
|
|
)
|
|
assert proc.returncode == 0, proc.stderr
|
|
assert "통과" in proc.stdout
|
|
|
|
|
|
def test_층_단추_셋_뿌리_줄_없음():
|
|
ts = _text("ui_template_item_picker.ts")
|
|
assert "children: [search.root, layerBar, treeHost]" in ts
|
|
assert "...PICKER_LAYERS.map((one) =>" in ts
|
|
assert 'variant: one === layer ? "filled" : "ghost"' in ts
|
|
# 고른 층의 자식부터 그림(뿌리 줄 없음)
|
|
assert "groups.find((group) => group.id === layer)?.children ?? []" in ts
|
|
# 처음 층 = 지금 항목 층 · 없으면 개인 · 없으면 마스터
|
|
assert "layer = layerOf(start);" in ts
|
|
# 공용 줄 부품 그대로
|
|
assert "createTreeRow(node, caret, depth" in ts
|
|
|
|
|
|
def test_개인_맨_위_새_항목은_빈_자리_오른쪽_클릭():
|
|
ts = _text("ui_template_item_picker.ts")
|
|
assert 'treeHost.addEventListener("contextmenu"' in ts
|
|
assert 'closest(".ui-tree__row")' in ts
|
|
assert "folder: { layer, path: [] }" in ts
|
|
|
|
|
|
def test_왼쪽_칸_폭_320_테두리_없음():
|
|
css = _text("ui_template_item_picker.css")
|
|
assert "grid-template-columns: var(--wf-left-panel-width) minmax(320px, 1fr);" in css
|
|
tree = css[css.index(".ui-item-picker__tree {") :]
|
|
tree = tree[: tree.index("}")]
|
|
assert "border" not in tree
|
|
theme = _text("ui_template_theme.css")
|
|
assert "--wf-left-panel-width: 320px;" in theme
|