85 lines
3.7 KiB
Python
85 lines
3.7 KiB
Python
"""505-3 B05 그림 · 글 — 임시 횡단 창 = B06 카드(형상 얹은 단면) · 빈칸 칩 그래프 오른쪽 위 · 곡선 판 가둠 ·
|
|
지반선 · 계획선 누름 통과 · STALE 글 · 창 단추 공용 꼴.
|
|
|
|
./venv/Scripts/python.exe -m pytest resources/tester/test_505_3_cross_card_text.py -q
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
from pathlib import Path
|
|
|
|
ROOT = Path(__file__).resolve().parents[2]
|
|
|
|
|
|
def _read(*parts: str) -> str:
|
|
return ROOT.joinpath(*parts).read_text(encoding="utf-8")
|
|
|
|
|
|
def test_측점_뜨기는_형상_얹은_단면도_돌려줌() -> None:
|
|
probe = _read("A00_Common", "design", "design_pipeline_probe.ts")
|
|
assert "Promise<{ preview: CrossPreviewResponse; section: CrossSection } | null>" in probe
|
|
assert "const section = stationSection(station, cross, {}, intervalM);" in probe
|
|
assert "attachStatus([section], status);" in probe
|
|
detail = _read("B05_Profile", "logic", "B05_Profile_Pipeline_Detail.ts")
|
|
assert "export function attachStatus(sections: CrossSection[], status: ShapeStatus)" in detail
|
|
|
|
|
|
def test_임시_횡단_창은_B06_카드() -> None:
|
|
modal = _read("B05_Profile", "B05_Profile_UI_Profile_CrossModal.ts")
|
|
assert "crossSourceOf(" in modal and "routeCrossCard(source," in modal
|
|
assert "now ? [now.preview] : await previewStructureSections(projectId(), [m])" in modal
|
|
# 서버 미리 뜬 것(분석 지형 다름)만 선 그림
|
|
assert "buildCrossSvg(preview, width, height)" in modal
|
|
assert 'class="ui-button"' not in modal
|
|
assert modal.count('class="ui-btn ui-btn--ghost ui-btn--sm" data-act=') == 3
|
|
css = _read("B05_Profile", "B05_Profile_UI_Profile_CrossModal.css")
|
|
assert ".b05-crossmodal__box > .b06-cross-card {" in css
|
|
|
|
|
|
def test_판_재료_한_벌() -> None:
|
|
card = _read("B05_Profile", "B05_Profile_UI_RouteEdit_Cross_Card.ts")
|
|
assert (
|
|
"return crossSourceOf(projectId, found, sections, detail.longitudinal.design_profiles, pane);"
|
|
in card
|
|
)
|
|
assert card.count("export function crossSourceOf(") == 1
|
|
|
|
|
|
def test_빈칸_칩은_머리_걷기_전에_꺼냄() -> None:
|
|
card = _read("B05_Profile", "B05_Profile_UI_RouteEdit_Cross_Card.ts")
|
|
chips = card.index('":scope > header .b06-cross-card__warning"')
|
|
remove = card.index(':scope > header, :scope > footer, .b06-cross-card__zoom"')
|
|
assert chips < remove
|
|
assert 'box.className = "b05-cross-chips";' in card
|
|
css = _read("B05_Profile", "B05_Profile_UI_Style_RouteEdit.css")
|
|
rule = css[css.index(".b05-cross-chips {") :]
|
|
assert "top: 4px;" in rule[:200] and "right: 4px;" in rule[:200]
|
|
assert ".b06-cross-card:has(> .b05-cross-chips) {\n position: relative;" in css
|
|
|
|
|
|
def test_곡선_판_가둠_도구줄_횡단판_종단판() -> None:
|
|
bar = _read("B05_Profile", "B05_Profile_UI_RouteEdit_CurveBar.ts")
|
|
for selector in (
|
|
".b05-routeedit__tools",
|
|
".b05-routeedit__side-wrap",
|
|
".b05-route-profile",
|
|
):
|
|
assert f'box("{selector}")' in bar
|
|
assert "top: Math.max(rect.top, tools?.bottom ?? rect.top) + 8," in bar
|
|
assert "right: Math.min(rect.right, side?.left ?? rect.right) - 8," in bar
|
|
assert "bottom: Math.min(rect.bottom, profile?.top ?? rect.bottom) - 8," in bar
|
|
|
|
|
|
def test_지반선_계획선_누름_통과() -> None:
|
|
css = _read("B06_Section", "B06_Section_UI_Style_Cross.css")
|
|
assert ".b06-chart__profile,\n.b06-chart__design-profile {\n pointer-events: none;" in css
|
|
|
|
|
|
def test_STALE_글_앞_단계() -> None:
|
|
locale = _read("ui_template", "ui_template_locale_common.ts")
|
|
assert (
|
|
'WF_State_Stale: ["다시 확인 필요 (앞 단계 변경)", "Stale (an earlier step changed)"],'
|
|
in locale
|
|
)
|
|
assert "하위 단계" not in locale
|