- cross_layout.json table_scale(모든 장 한 값 · 0.5~2.0 · 기본 1) · 저장 검사 · 「모든 장」 저장이 배율 안 지움 - 표 폭 · 행 높이 · 글 · 글 줄 높이에 배율 · 174 쌓기 · 넘침 판정이 같은 값으로 다시 셈 - 확정 장 그대로 · 다른 배율로 확정된 장 = stale_scale 안내 - 배치 칸 줄에 「표 배율 [1] [배율 적용]」 - 새 시험 test_180_2_b07_cross_scale · test_140 기본값 · test_153_1 배율 칸 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TNMXVCZXMpHpVvqmFkeChL
73 lines
2.5 KiB
Python
73 lines
2.5 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"]
|
|
|
|
|
|
def test_표_배율_칸(out):
|
|
scale = out["scale"]
|
|
assert scale["labels"] == ["배치 열", "행", "표 배율"]
|
|
assert scale["input"] == {"value": "1", "min": "0.5", "max": "2", "step": "0.1"}
|
|
assert scale["buttons"] == ["이 장", "모든 장", "배율 적용"]
|
|
assert scale["applied"] == [1.5]
|
|
assert scale["toasts"] == ["error"] # 2.5 = 범위 밖
|