- 좌측 패널 · 아래 단추 넷 · 종단도 · 구조물 배치 폼을 페이지에 한 번만 만듦(design_shared) — 두 보기가 같은 노드 - 보기는 가운데 위 칸만: 종단 보기 = 3D(design_view_profile) · 횡단 보기 = 횡단 카드(design_view_cross · 처음 보일 때 그림) - 옛 B05_Profile_UI_Page · B06_Section_UI_Page 삭제 · 한 벌이 받은 조작은 지금 보기로, 관 목록 · 횡단 재계산 알림은 두 보기 모두로 - 진행 단계 종단설계 · 횡단설계 두 칸이 보기를 따라 켜짐 · 누르면 주소만 바꿈 · 제목도 따라감(setTitle · setActiveStep) - [저장] · [확정] 한 벌 — 두 보기 몫을 모아 saveDesign 한 번 · 종단 보기 [확정] 켬(횡단 보기를 숨긴 채 세워 횡단 자료를 얻음) - [초기화] · 계획노선 편집은 같은 페이지라도 다시 세움(remountRoute) - 덧붙임: 방향키는 초점 있는 쪽만(조정창 ↔ 종단도 계획고) · 횡단 보기 계획고 편집에도 [3D 업데이트] 대기 표시 · 종단 보기 폼 관 옵션을 횡단 캐시에도 얹음 · 종단 보기에서 횡단 조정 칸 가림 - 나눔: Cross_View 756→658(_Cross_View_Frame) · Page_Structures_Panel 700→547(_Structures_Spec) · 옛 B05 Page 786 → design_view_profile 638(_Page_Latest · _Page_Stations) - 시험: test_design_view_parity 한 벌 기준(한 패널 · 보기 오가도 같은 노드) · page_single · profile_single · save_channels · save_recompute 등 옮긴 자리로 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KmELpdXFDRZHhfbGuRhSmL
85 lines
3.3 KiB
Python
85 lines
3.3 KiB
Python
# -*- coding: utf-8 -*-
|
|
"""종단도 한 벌(계획서 24-2c) 회귀검증.
|
|
|
|
두 보기(B05 종단 · B06 횡단)가 **같은 종단도**(`A00_Common/design/design_profile.ts`)를 쓰고
|
|
같은 오른쪽 판(배수유역도)을 끼우는지, 옛 B06 위쪽 붙박이 종단이 남지 않았는지, 계획고 초안이
|
|
등록부 칸(`alignment-draft`)으로 옮겨져 되돌리기가 그 칸을 찍는지 본다.
|
|
Node 헬퍼(`helper_design_profile_single.cjs`)가 TS 를 트랜스파일해 돌린다.
|
|
"""
|
|
|
|
import json
|
|
import os
|
|
import subprocess
|
|
from pathlib import Path
|
|
|
|
import pytest
|
|
|
|
HERE = Path(__file__).resolve().parent
|
|
ROOT = HERE.parent.parent
|
|
|
|
|
|
def _read(relative: str) -> str:
|
|
return (ROOT / relative).read_text(encoding="utf-8")
|
|
|
|
|
|
@pytest.fixture(scope="module")
|
|
def results():
|
|
proc = subprocess.run(
|
|
["node", os.path.join(HERE, "helper_design_profile_single.cjs")],
|
|
capture_output=True,
|
|
text=True,
|
|
encoding="utf-8",
|
|
timeout=60,
|
|
)
|
|
assert proc.returncode == 0, proc.stderr
|
|
return json.loads(proc.stdout)
|
|
|
|
|
|
def test_두_보기가_같은_종단도와_같은_판():
|
|
"""종단도는 한 페이지 한 벌(계획서 24-3b) — 두 보기는 같은 노드에 제 알림만 건다."""
|
|
shared = _read("A00_Common/design/design_shared.ts")
|
|
assert shared.count("createDesignProfile(") == 1
|
|
assert "side: drainageSide" in shared and "sideTool: drainageSideTool" in shared
|
|
b05 = _read("B05_Profile/B05_Profile_UI_Profile_Panel.ts")
|
|
b06 = _read("B06_Section/B06_Section_UI_Section_View_Profile.ts")
|
|
for source, view in ((b05, "profile"), (b06, "cross")):
|
|
assert "createDesignProfile(" not in source
|
|
assert "sharedProfile(shared)" in source
|
|
assert f'bindDesignView(shared, "{view}"' in source
|
|
|
|
|
|
def test_옛_B06_위쪽_종단이_남지_않음():
|
|
view = _read("B06_Section/B06_Section_UI_Section_View.ts")
|
|
assert "createSectionProfile(" in view
|
|
assert "drawLongitudinalPanel" not in view
|
|
assert "b06-section__panel" not in view
|
|
for gone in ("Draw", "Chart", "Panel"):
|
|
assert not (ROOT / f"B06_Section/B06_Section_UI_Section_View_{gone}.ts").exists()
|
|
|
|
|
|
def test_막기_규칙은_종단도_한_곳():
|
|
profile = _read("A00_Common/design/design_profile.ts")
|
|
assert profile.count("blocksMinCover(") == 1
|
|
# 판이 없는 보기도 관 목록을 넘겨 최소 흙덮기를 판정한다.
|
|
assert "setMinCoverPipes(" in profile
|
|
assert "setMinCoverPipes(" in _read("B06_Section/B06_Section_UI_Section_View_Profile.ts")
|
|
|
|
|
|
def test_크기_접기_키는_하나():
|
|
drag = _read("B05_Profile/B05_Profile_UI_Profile_Drag.ts")
|
|
assert 'stateKey("profile-height")' in drag
|
|
assert '"profile-collapsed"' in drag
|
|
assert '["section-panel-height", "profile-height"]' in drag # 옛 값 옮겨 받음
|
|
|
|
|
|
def test_초안은_등록부_칸으로_옮겨_받음(results):
|
|
assert results["adopted"] == {"station_offsets": {"20.000": 0.3}, "curve_radii": {}}
|
|
assert results["keysAfterAdopt"] == ["aislo:draft:alignment-draft:p-1:7"]
|
|
assert results["sameSlot"]["station_offsets"] == {"40.000": 0.1}
|
|
|
|
|
|
def test_되돌리기가_새_칸을_찍음(results):
|
|
assert results["beforeUndo"]["station_offsets"] == {"40.000": 0.2}
|
|
assert results["undone"] is True
|
|
assert results["afterUndo"]["station_offsets"] == {"40.000": 0.1}
|