Files
Aislo/resources/tester/test_408_4_bottom_row.py
T
eomsangdonandClaude Opus 5.5 75706f24f8 fix(B05 노선 편집 평면 아래 글판): 횡단 판 넓을 때 상태 글판 · 잰 값 창 안 겹침 (408-4)
- 횡단 판 왼쪽 빈 폭을 두 글판이 반씩(--b05-bottom-half) · 좁으면 줄바꿈
- 반 폭 200 px 아래면 잰 값 창을 상태 글판 위로 쌓음(is-narrow-bottom · --b05-info-h · logic bottomRowNarrow)
- Chrome 관찰에 상태 글판 · 횡단 판 크기 더함
- 시험 test_408_4_bottom_row 새로 · 345_5c 폭 규칙 고쳐 씀

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ji4nuyLVHcxrXWHTdb5nRD
2026-10-18 09:37:26 +09:00

66 lines
2.5 KiB
Python

"""408-4 횡단 판이 넓을 때 상태 글판 · 잰 값 창 겹침 — 횡단 판 왼쪽 빈 폭을 반씩 나눠 쓰고, 반이 200 px
아래면(`bottomRowNarrow`) 잰 값 창을 상태 글판 위로 쌓음(둘 다 빈 폭 전부 · 좁으면 줄바꿈).
TS 셈은 `helper_408_2_status_lift.cjs`(Node · `logic/B05_Profile_RouteEdit_InfoLift.ts`).
./venv/Scripts/python.exe -m pytest resources/tester/test_408_4_bottom_row.py -q
"""
import json
import subprocess
from pathlib import Path
import pytest
B05 = Path(__file__).resolve().parents[2] / "B05_Profile"
CSS = B05 / "B05_Profile_UI_Style_RouteEdit.css"
HELPER = Path(__file__).with_name("helper_408_2_status_lift.cjs")
@pytest.fixture(scope="module")
def got() -> dict:
run = subprocess.run( # noqa: S603 — 고정 실행 파일
["node", str(HELPER)], capture_output=True, text=True, encoding="utf-8", timeout=60
)
assert run.returncode == 0, run.stderr
return json.loads(run.stdout)
def _rules(selector: str) -> list[str]:
css = CSS.read_text(encoding="utf-8")
return [part[: part.index("}")] for part in css.split(f"{selector} {{")[1:]]
def test_반_폭이_모자라면_쌓음(got) -> None:
# (1172 - 36 - 736) / 2 = 200 → 나란히 · 737 → 쌓음
assert got["narrow"] == [False, False, True, False, True]
def test_두_글판이_반_폭까지만() -> None:
assert any(
"max-width: min(460px, 46%, var(--b05-bottom-half));" in r
for r in _rules(".b05-routeedit__info")
)
assert any("max-width: var(--b05-bottom-half);" in r for r in _rules(".b05-routeedit__measure"))
half = _rules(".b05-routeedit")[0]
assert (
"--b05-bottom-half: max(0px, calc((100% - 3 * var(--spacing-12) - var(--b05-side-open)) / 2));"
in half
)
def test_좁으면_잰_값_창이_상태_글판_위로() -> None:
narrow = _rules(".b05-routeedit.is-narrow-bottom")[0]
assert "calc(100% - 2 * var(--spacing-12) - var(--b05-side-open))" in narrow
measure = _rules(".b05-routeedit.is-narrow-bottom .b05-routeedit__measure")[0]
assert "var(--b05-info-h, 0px)" in measure and "var(--b05-profile-cover, 0px)" in measure
def test_편집기가_횡단_판_글판_크기를_관찰() -> None:
chrome = (B05 / "B05_Profile_UI_RouteEdit_Chrome.ts").read_text(encoding="utf-8")
assert (
"lift.observe(info)" in chrome
and 'lift.observe(overlay.querySelector(".b05-routeedit__side-wrap")!)' in chrome
)
assert '"is-narrow-bottom"' in chrome and '"--b05-info-h"' in chrome