Files
Aislo/resources/tester/test_568_1_map_tools.py
T
eomsangdonandClaude Opus 5.5 38c40f70bc feat(ui_template): 지도 도구줄 부품 · 아이콘 여덟 · 부품 모음 견본 (PLAN 568-1 · 요구 395-1)
- ui_template_map_tools.ts · .css — 아이콘 단추 한 벌(차례 · 나눔선 · 켬끔 aria-pressed · [?] 안내 판)
- 아이콘 더함 — ripple · tallymarks · percentage · magnet · satellite · droplet · borderAll · angle(Tabler MIT)
- 부품 모음 틀 묶음에 「지도 도구줄」 견본 · 시험 test_568_1 · test_552_4 목록에 map-tools

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 06:59:33 +09:00

82 lines
2.6 KiB
Python

"""568-1 지도 도구줄 부품 지킴 시험 — 화면 확인은 부품 모음(`#/b01-account?view=ui-kit`) · ORCA.
· 단추 목록의 아이콘이 모두 아이콘 묶음에 있음 · 새 아이콘 여덟(도구 넷 · 겹 넷)
· 켬끔 단추 = aria-pressed · [?] = data-act="hint-toggle" + aria-expanded · 안내 판 기본 접힘
./venv/Scripts/python.exe -m pytest resources/tester/test_568_1_map_tools.py -q
"""
from __future__ import annotations
import re
from pathlib import Path
ROOT = Path(__file__).resolve().parents[2]
UI = ROOT / "ui_template"
TS = (UI / "ui_template_map_tools.ts").read_text(encoding="utf-8")
ICONS = (UI / "ui_template_icons.ts").read_text(encoding="utf-8")
CSS = (UI / "ui_template_map_tools.css").read_text(encoding="utf-8")
def _icon_names() -> set[str]:
body = ICONS[ICONS.index("const PATHS") : ICONS.index("} as const")]
return set(re.findall(r"^ (\w+):", body, re.M))
def test_새_아이콘_여덟():
names = _icon_names()
for n in (
"ripple",
"tallymarks",
"percentage",
"magnet",
"satellite",
"droplet",
"borderAll",
"angle",
):
assert n in names, n
def test_단추_목록_아이콘_차례():
table = TS[TS.index("export const MAP_TOOLS") : TS.index("satisfies")]
rows = re.findall(
r'^ "?([\w-]+)"?: \{ icon: "(\w+)", title: "[^"]+"(, toggle: true)? \}', table, re.M
)
acts = [a for a, _, _ in rows]
assert acts == [
"undo",
"redo",
"view3d",
"rotate-ccw",
"rotate-cw",
"contour-minor",
"stations",
"slopes",
"footprint",
"measure",
"station-snap",
]
names = _icon_names()
assert all(icon in names for _, icon, _ in rows)
toggles = {a for a, _, t in rows if t}
assert toggles == {
"contour-minor",
"stations",
"slopes",
"footprint",
"measure",
"station-snap",
}
def test_켬끔_안내_판():
assert "pressed: tool.toggle ? (opts.pressed ?? false) : undefined" in TS
assert "button.dataset.act = act;" in TS
assert 'toggle.dataset.act = "hint-toggle";' in TS
assert 'toggle.setAttribute("aria-expanded", String(open));' in TS
assert "setOpen(opts.hint.open ?? false);" in TS # 기본 접힘
hint = CSS[CSS.index(".ui-map-tools__hint {") :]
assert "display: none;" in hint[: hint.index("}")]
assert "display: grid;" in CSS[CSS.index(".ui-map-tools__hint.is-open {") :]
assert "pointer-events: none;" in CSS # 빈 자리 · 글판은 지도 조작 통과