Files
Aislo/resources/tester/test_280_2_step_nav.py
T
eomsangdonandClaude Opus 5.5 a1069f270a feat(529-1): 단계 틀 인자(아이콘 · [<][>] 묶음 · 도움말 이름) · D · E 단계 빈 길 일곱
- createWorkflowLayout icons 인자(없으면 B 일곱 아이콘 그대로)
- [?] [<] [>] 묶음 = B05~B09 · D02~D04 · E02~E05 · 묶음 안에서만 오감 · 설명서 이름 B0N/D0N/E0N
- 서버 설명서 주소 D01~D04 · E01~E05 허용 · 우클릭 막기 · 돋보기 d · e 주소
- ROUTES D01~E05 · PLAN_STEP_ROUTES · STAB_STEP_ROUTES · A00_Common/group_workflow(빈 단계 = 틀 · 좌측 [?] 줄 · 단계 막대)
- 페이지 폴더마다 draft/<폴더>_Route.ts · tsconfig 에 D0* · E0* · 문구 ui_template_locale_de
- 시험: 280-2 대역에 D · E 묶음 · 54-2 D · E 설명서 길

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

115 lines
5.3 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 ("d02-plan-base", "d04-plan-confirm", "e02-stab-ground", "e05-stab-report"):
assert rows[route]["plain"]["labels"] == ["?", "<", ">", "저장"], route
# 묶음 첫 단계 [<] · 끝 단계 [>] 흐림(B 묶음과 따로)
assert rows["d02-plan-base"]["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]
@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