Files
Aislo/resources/tester/test_153_1_b07_cross_layout.py
T
eomsangdonandClaude Opus 5.5 3eaa165cbc feat(B07): 횡단 장 배치 칸을 횡단도 묶음 맨 아래 공용 입력칸 · 작은 단추로 이동(153-1)
- 배치 열 · 행 = 공용 입력칸 · [이 장] [모든 장] = 작은 ghost 단추
- 장 아닌 도면 = 기본값 · [이 장] 꺼짐
- 정보 칸을 다시 그려도(장 확정 뒤) 칸이 남음

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TNMXVCZXMpHpVvqmFkeChL
2026-10-09 19:02:54 +09:00

64 lines
2.1 KiB
Python

# -*- coding: utf-8 -*-
"""153-1 B07 횡단 장 배치 칸.
못박는 것
- 배치 칸 자리 = 좌측 「횡단도」 묶음 맨 아래(한 번만) — 정보 칸을 다시 그려도 안 사라짐.
- 공용 입력칸(ui-field__label · ui-input--sm · 1~10) 둘 + 작은 ghost 단추 [이 장] [모든 장].
- 장이 아니면 [이 장] 꺼짐 · [모든 장]은 됨 · 범위 밖 값 = 알림만.
Node 헬퍼 `helper_153_b07_cross_layout.cjs` 가 화면 그릇 흉내로 돌림. 화면은 사용자 확인.
"""
import json
import os
import subprocess
import pytest
HERE = os.path.dirname(os.path.abspath(__file__))
@pytest.fixture(scope="module")
def out():
proc = subprocess.run(
["node", os.path.join(HERE, "helper_153_b07_cross_layout.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):
assert out["slotLast"] is True
assert out["slotCount"] == 1
def test_공용_입력칸과_작은_단추(out):
sheet = out["sheet"]
assert sheet["boxClass"] == "b07-cross-layout"
assert sheet["labels"] == ["배치 열", "행"]
assert [i["value"] for i in sheet["inputs"]] == ["3", "4"]
for field in sheet["inputs"]:
assert field["type"] == "number" and field["min"] == "1" and field["max"] == "10"
assert "ui-input--sm" in field["cls"]
assert [b["text"] for b in sheet["buttons"]] == ["이 장", "모든 장"]
for button in sheet["buttons"]:
assert button["cls"] == "ui-btn ui-btn--ghost ui-btn--sm" and not button["disabled"]
def test_이_장_모든_장_누름(out):
clicks = out["sheetClicks"]
assert clicks["applied"] == [[2, 5]]
assert clicks["defaults"] == [[2, 5]]
assert [t[0] for t in clicks["toasts"]] == ["error"] # 11 = 범위 밖
def test_장_아니면_이_장_꺼짐(out):
not_sheet = out["notSheet"]
assert not_sheet["disabled"] == [True, False]
assert not_sheet["defaults"] == [[4, 4]]
assert not_sheet["values"] == ["4", "4"]