Files
Aislo/resources/tester/test_294_6_ford_linked_mark.py
T

82 lines
2.8 KiB
Python

"""294-6 물넘이 월류 폭으로 옆 측점 카드에 그려진 포장 = 연결 표기(요구 190-3).
못박는 것
- 옆 카드(물넘이 측점 ≠ 카드 측점) = 포장층 · 월류 높이선에 `is-linked`(흙막이 연동 꼴) ·
호버 글 「물넘이포장 · 4+10 연결」 · 앞서 그린 것(세월교 점선)은 그대로.
- 주인 카드 = 옛 꼴(연결 표식 · 글 없음).
- 고름 = 주인 구조물 그대로(`data-structure-id` pipe-90.00 · 강조 켜짐) · CSS 연결 꼴이 강조를 안 덮음.
- 카드 그리기(`Cross_View`)가 물넘이포장 바로 뒤에 표기를 부름.
진짜 TS 는 `helper_294_6_ford_linked_mark.cjs` 가 Node 로 돌림. 화면은 브레인 확인.
"""
from __future__ import annotations
import json
import subprocess
from pathlib import Path
import pytest
HERE = Path(__file__).resolve().parent
ROOT = HERE.parents[1]
pytestmark = pytest.mark.skipif(
not (ROOT / "config" / "node_modules" / "typescript").is_dir(),
reason="프론트엔드 의존성 미설치",
)
@pytest.fixture(scope="module")
def out() -> dict:
proc = subprocess.run(
["node", str(HERE / "helper_294_6_ford_linked_mark.cjs")],
capture_output=True,
text=True,
encoding="utf-8",
timeout=60,
)
assert proc.returncode == 0, proc.stderr
return json.loads(proc.stdout)
def test_옆_카드_연결_꼴_호버_글(out):
neighbor = out["neighbor"]
assert neighbor["marked"] is True
assert len(neighbor["classes"]) == 2
assert all("is-linked" in c.split() for c in neighbor["classes"])
assert neighbor["titles"] == [["물넘이포장 · 4+10 연결"]] * 2
assert neighbor["beforeClass"] == "b06-chart__ford-deck-plan"
def test_주인_카드_옛_꼴(out):
owner = out["owner"]
assert owner["marked"] is False
assert not any("is-linked" in c.split() for c in owner["classes"])
assert owner["titles"] == [[], []]
assert out["noSpec"] is False
def test_고름은_주인_구조물(out):
for card in (out["neighbor"], out["owner"]):
assert card["pick"] == ["pipe-90.00"]
assert "is-active" in card["classes"][0].split()
def test_CSS_연결_꼴_강조가_먼저():
css = (ROOT / "B06_Section" / "B06_Section_UI_Style_Cross_Areas.css").read_text(
encoding="utf-8"
)
assert ".b06-chart__ford-pavement.is-linked:not(.is-active)" in css
assert ".b06-chart__ford-deck-plan.is-linked" in css
def test_카드가_물넘이포장_뒤에_표기_부름():
view = (ROOT / "B06_Section" / "B06_Section_UI_Cross_View.ts").read_text(encoding="utf-8")
start = view.index("const fordFrom = plotLayer.children.length;")
call = view.index("appendFordPavementOverlay(", start)
mark = view.index(
"markLinkedFordPavement(plotLayer, fordFrom, section, stationInterval);", call
)
assert start < call < mark