Files
Aislo/resources/tester/test_354_1_masshaul_own_panel.py
T

86 lines
3.7 KiB
Python

# -*- coding: utf-8 -*-
"""354-1 유토곡선 = 배수유역도처럼 자기 판(요구 235-7).
- 종단 열(`b05-route-profile__column`) = [종단 칸(bodyWrap), 유토 판] · content 안이라 종단 [창 분할]
(`.is-popout > :not(content)` 숨김)에도 같이 감 · B05 · B06 이 같은 `design_profile` 하나.
- 유토 판은 흐름 칸(겹침 아님) · 자기 리사이저 높이 · 접으면 머리줄만(손잡이 · [창 분할] 닿음).
- 높이 나눔 · 표 쌓기에서 빠짐(표 bottomOffset 없음) · X 동기화는 그대로.
"""
import os
import re
from pathlib import Path
HERE = os.path.dirname(os.path.abspath(__file__))
ROOT = Path(HERE).parents[1]
def read(rel: str) -> str:
return (ROOT / rel).read_text(encoding="utf-8")
def css_block(css: str, selector: str) -> str:
m = re.search(r"(?:^|\n)" + re.escape(selector) + r" \{([^}]*)\}", css)
assert m, selector
return m.group(1)
def test_종단_열_아래_자기_칸():
overlays = read("A00_Common/design/design_profile_overlays.ts")
assert 'column.className = "b05-route-profile__column";' in overlays
assert "column.append(bodyWrap, massHaul.overlay);" in overlays
assert "bodyWrap.append(massHaul.overlay" not in overlays
assert "massHaul.attachScrollSync(body);" in overlays
profile = read("A00_Common/design/design_profile.ts")
assert "content.append(column);" in profile
assert sum(1 for _ in profile.splitlines()) <= 700
def test_종단_창_분할에도_안_숨음():
page = read("A00_Common/design/design_page.css")
assert ".b05-route-profile.is-popout > :not(.b05-route-profile__content)" in page
# 유토 판은 뿌리 바로 아래가 아니라 content > column 안
overlays = read("A00_Common/design/design_profile_overlays.ts")
assert "root.append" not in overlays
def test_흐름_칸_자기_높이_접으면_머리줄():
css = read("B05_Profile/B05_Profile_UI_Style_MassHaul.css")
panel = css_block(css, ".b05-profile__masshaul-overlay")
assert "position: relative;" in panel and "absolute" not in panel
assert "height: var(--b05-masshaul-height, 280px);" in panel
assert "flex: none;" in panel
column = css_block(css, ".b05-route-profile__column")
assert "flex-direction: column;" in column
hide = css_block(
css,
".b05-profile__masshaul-overlay.is-collapsed:not(.is-popout) > :not(.b05-profile__masshaul-head)",
)
assert "display: none;" in hide
assert "display: none;" in css_block(
css, ".b05-route-profile.is-collapsed .b05-profile__masshaul-overlay"
)
mass = read("B05_Profile/B05_Profile_UI_Profile_MassHaul.ts")
assert "head.append(handle);" in mass
assert "overlay.append(resizer.root, head, bar, scroll, legendLayer, pendingChip);" in mass
assert 'overlay.classList.toggle("is-collapsed", !next);' in mass
assert "overlay.hidden" not in mass
# 새 창으로 뗀 판은 접힘이어도 그림
assert 'const shown = (): boolean => open || overlay.classList.contains("is-popout");' in mass
def test_창_분할_단추는_머리줄_맨_앞():
popout = read("A00_Common/design/design_profile_popout.ts")
assert "massHead.prepend(button);" in popout
assert "home: () => column?.append(massOverlay)," in popout
page = read("A00_Common/design/design_page.css")
assert ".b05-profile__masshaul-overlay > .b05-subpanel__popout" not in page
def test_높이_나눔_표_쌓기에서_빠짐():
heights = read("B05_Profile/B05_Profile_UI_Profile_Heights.ts")
table = read("B05_Profile/B05_Profile_UI_Profile_TableOverlay.ts")
assert "massHaul" not in heights
assert "setBottomOffset" not in heights and "setBottomOffset" not in table
assert "bottomOffset" not in table