Files
Aislo/resources/tester/test_224_1b_masshaul_docked.py
T

72 lines
2.4 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# -*- coding: utf-8 -*-
"""224-1b(PLAN 325-2 · 354-1) 유토곡선 판 높이 나눔 · 방향키.
- 유토곡선 = 종단 열 아래 자기 판(354-1) — 높이 나눔 · 끌기에 안 낌(본문 높이에서 이미 빠짐) ·
인라인 임시 축소도 안 씀. 나눔은 그래프 · 표 둘.
- 뗀 유토 판(`is-popout`)은 메인 보이는 구간 세로 범위(viewRange)를 안 씀 — 노선 전체 세로.
- 방향키 ←→ 판정은 마지막 누름이 종단 뿌리 · 뗀 유토 · 뗀 배수 판 안이면 종단도 몫.
`helper_224_1b_masshaul_docked.cjs` 가 진짜 TS 를 가짜 DOM 위에서 돌림.
"""
import json
import os
import re
import subprocess
from pathlib import Path
import pytest
HERE = os.path.dirname(os.path.abspath(__file__))
B05 = Path(HERE).parents[1] / "B05_Profile"
@pytest.fixture(scope="module")
def r():
proc = subprocess.run(
["node", os.path.join(HERE, "helper_224_1b_masshaul_docked.cjs")],
capture_output=True,
text=True,
encoding="utf-8",
timeout=60,
)
assert proc.returncode == 0, proc.stderr
return json.loads(proc.stdout)
def test_유토_판은_나눔에_안_낌(r):
"""본문 400 − 알약 40 = 360 · 손잡이 띠 13 → 표 없음 그래프 347."""
assert r["tableClosed"] == {"chartHeight": 347, "inline": ""}
assert r["tableFits"] == {"chartHeight": 147, "inline": ""}
# 표 300 은 예산 247 넘어 247 로 줄고 그래프 100
assert r["tableShrinks"] == {"chartHeight": 100, "inline": "247px"}
def test_방향키_판정(r):
assert r["arrows"] == {
"profile": True,
"mass": True,
"drainage": True,
"card": False,
"none": False,
}
def test_끌기도_유토_판_안_셈():
drag = (B05 / "B05_Profile_UI_Profile_Drag.ts").read_text(encoding="utf-8")
heights = (B05 / "B05_Profile_UI_Profile_Heights.ts").read_text(encoding="utf-8")
for src in (drag, heights):
assert "massDocked" not in src and "MASSHAUL_MIN_HEIGHT" not in src
assert "mass:" not in src
# 유토 판 리사이저 끌기 출처만 봄
assert drag.count("massHaul.overlay") == 1
assert "massHaul" not in heights
def test_뗀_유토는_노선_전체_세로():
mass = (B05 / "B05_Profile_UI_Profile_MassHaul.ts").read_text(encoding="utf-8")
assert re.search(
r'viewRange: overlay\.classList\.contains\("is-popout"\) \? undefined : params\.axis\.viewRange',
mass,
)