Files
Aislo/resources/tester/test_280_2_step_nav.py
T
eomsangdonandClaude Opus 5.5 29512c001b feat(D 예정노선): D02 기준 지정 걷음 · 지점 마킹 = D03 노선분석 · 기준점 둘레 1 km 처음 받기 · 조용히 이어 받기 (PLAN 591-2 · 요구 452 · 453)
- D02 걷음 — 길 · 단계(PLAN 단계 둘 = 노선 분석 · 확정) · [>] · 대시보드 단계 점 · 서버 길 · 폴더 만들기 · 캐시 등록 · 글 · 가이드 폴더
- 등록 [등록] · 받은 예정노선 [보기] = D03 으로 곧바로
- D03 지점 = 긋기에 붙는 점 · 목록 칸(여섯 색 · 「지점 N」 · 🗑) · 핀 끌기 = 그 자리 노선 노드 같이 · [저장] 몸에 실음 · [초기화] = 선만 지우고 지점 남김
- 지도 우클릭 메뉴(부품 상자) — 여기서 긋기 시작(빈 땅 = 새 본선) · 갈래 시작 · 이어 긋기 · 지점 놓기 · 지점 지우기 · 긋기 끝
- 받기 — 처음 = 등록 기준점 둘레 ± 1 km(지점 · 선 없을 때) · 지점 · 선 · 지도 보기 가운데가 받은 범위 밖이면 조용히 이어 받음(단추 · 막는 창 걷음 · 실패만 [다시 받기])
- 좌표계 = 파일 머리 · 없으면 기준점 경도 TM 띠
- 시험: 529_3(D02 지점 API) 지움 → 591_2 로 갈음 · 280_2 · 528 · 530_2 · 547_1 · 548 · 553_4 · 556_2 · 560_4 · 401 · 54_2 = D02 단계 · 페이지 걷음에 맞춤 · 590_1 · 530_2_analyze = 사업연도 · 기준점 한 번에 읽음 · 591_1 D04 씨앗 시험 = 590-1 이 씨앗 줄 걷음에 맞춤

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 10:19:34 +09:00

123 lines
5.8 KiB
Python

# -*- coding: utf-8 -*-
"""요구 280-2 · PLAN 481-1 — 좌측 아래 [?] [<] [>] 페이지 이동.
① 줄 차례 = [?] [<] [>] + 그 페이지 단추 · 다섯 주소만(b03 · b04 · b09-print · m01 · m02 = [?] 만) · B05 [<] · B09 [>] 흐림
② [<] [>] = 이웃 단계 단추 누름(`onStepClick` 한 길) · 막힌 단계(NOT_STARTED 만) = 누르지 않고 그 단추 title 알림
③ B05 ↔ B06 = 같은 페이지 주소만(다시 안 실음) · 주소 바뀌면 [<] 다시 맞춤 · 도크 = [저장] [초기화] 둘(496-1)
"""
import json
import os
import subprocess
from pathlib import Path
import pytest
HERE = os.path.dirname(os.path.abspath(__file__))
ROOT = Path(HERE).parents[1]
FIVE = ("b05-profile", "b06-section", "b07-design-detail", "b08-quantity", "b09-estimation")
OTHERS = ("b03-file-input", "b04-preprocess", "b09-print", "m01-master-data", "m02-master-template")
@pytest.fixture(scope="module")
def results():
proc = subprocess.run(
["node", os.path.join(HERE, "helper_280_2_step_nav.cjs")],
capture_output=True,
text=True,
encoding="utf-8",
timeout=60,
)
assert proc.returncode == 0, proc.stderr
return json.loads(proc.stdout)
def test_529_1_D_E_묶음_안에서만_앞뒤(results):
rows = results["rows"]
for route in ("d01-plan-register", "e01-stab-register"):
assert rows[route]["plain"]["labels"] == ["?", "저장"], route
for route in ("d03-plan-analysis", "d04-plan-confirm", "e02-stab-ground", "e05-stab-report"):
assert rows[route]["plain"]["labels"] == ["?", "<", ">", "저장"], route
# 묶음 첫 단계 [<] · 끝 단계 [>] 흐림(B 묶음과 따로)
assert rows["d03-plan-analysis"]["plain"]["disabled"][:3] == [False, True, False]
assert rows["d04-plan-confirm"]["plain"]["disabled"][:3] == [False, False, True]
assert rows["e02-stab-ground"]["plain"]["disabled"][:3] == [False, True, False]
assert rows["e05-stab-report"]["plain"]["disabled"][:3] == [False, False, True]
# 565-1 — 광역(E07) 뒤에 보고서 · 진짜 차례도 E05 가 끝
assert rows["e07-stab-area"]["plain"]["disabled"][:3] == [False, False, False]
config = (ROOT / "config" / "config_frontend.ts").read_text(encoding="utf-8")
stab = config.split("export const STAB_STEP_ROUTES = [")[1].split("]")[0]
assert [s.strip() for s in stab.split(",") if s.strip()][-2:] == [
"ROUTES.E07_STAB_AREA",
"ROUTES.E05_STAB_REPORT",
]
@pytest.mark.parametrize("shape", ["helpRow", "plain"])
def test_다섯_주소만_물음_앞뒤_차례(results, shape):
for route in FIVE:
assert results["rows"][route][shape]["labels"] == ["?", "<", ">", "저장"], route
for route in OTHERS:
assert results["rows"][route][shape]["labels"] == ["?", "저장"], route
def test_B05_앞_B09_다음만_흐림(results):
for route in FIVE:
expected = [False, route == "b05-profile", route == "b09-estimation", False]
assert results["rows"][route]["helpRow"]["disabled"] == expected, route
def test_앞뒤는_이웃_단계_누름(results):
nav = results["nav"]
assert nav["b05Prev"] == {"calls": [], "toasts": []} # 흐림 — 누름 안 감(496-1)
assert nav["b05Next"] == {"calls": ["3:b06-section"], "toasts": []}
# B05 → B06 은 같은 페이지 — setActiveStep 으로 켜진 칸이 바뀐 뒤 이웃
assert nav["b06Prev"] == {"calls": ["2:b05-profile"], "toasts": []}
assert nav["b06Next"] == {"calls": ["4:b07-design-detail"], "toasts": []}
assert nav["b09Prev"] == {"calls": ["5:b08-quantity"], "toasts": []}
assert nav["b09Next"] == {"calls": [], "toasts": []}
def test_B05_앞_흐림은_주소_따라_다시_맞춤(results):
assert results["nav"]["prevDisabled"] == {"b05": True, "b06": False, "back": True}
def test_막힌_단계는_알림만(results):
nav = results["nav"]
assert nav["blockedNext"] == {"calls": [], "toasts": ["WF_State_NotStarted"]}
assert nav["userPrev"] == {"calls": ["2:b05-profile"], "toasts": []}
lock = {"disabled": True, "title": "시스템 관리자 전용 단계입니다."}
assert nav["userB04"] == lock and nav["userB04Repaint"] == lock
def test_STALE_은_색만_막지_않음(results):
nav = results["nav"]
assert nav["staleNext"] == {"calls": ["4:b07-design-detail"], "toasts": []}
assert "state-stale" in nav["staleClass"].split()
def test_다시_칠하기와_켤_칸_목록(results):
nav = results["nav"]
assert nav["repaintNext"] == {"calls": ["4:b07-design-detail"], "toasts": []}
assert "state-in_progress" in nav["repaintClass"].split()
assert "state-not_started" not in nav["repaintClass"].split()
# B05 · B06 화면 = 2 · 3 · 4 늘 켬 — 운영 · 체인 직후 B07 NOT_STARTED 라도 [>] 가 감 · B08 은 막힘
assert nav["listNext"] == {"calls": ["4:b07-design-detail"], "toasts": []}
assert nav["listB08"] is True
def test_B05_B06_사이는_주소만_다시_안_실음():
page = (ROOT / "A00_Common" / "design" / "design_page.ts").read_text(encoding="utf-8")
assert "if (designViewOf(route)) navigateTo(route);" in page
dock = (ROOT / "A00_Common" / "design" / "design_dock.ts").read_text(encoding="utf-8")
shared = (ROOT / "A00_Common" / "design" / "design_shared.ts").read_text(encoding="utf-8")
for text in (dock, shared):
assert "switchView" not in text
assert "row.append(saveButton, resetButton);" in dock
assert "confirmButton" not in dock and 'variant: "danger-ghost"' in dock
assert "currentStage: [2, 3, 4]" in page
assert "else if (stepIndex >= 4) confirmAndGo(shared, route);" in page
locale = (ROOT / "ui_template" / "ui_template_locale_b2.ts").read_text(encoding="utf-8")
assert "Design_Btn_ToCross" not in locale and "Design_Btn_ToProfile" not in locale
assert "B06_Profile_Btn_Confirm" not in locale