Files
Aislo/resources/tester/test_153_1_b07_cross_layout.py
T
eomsangdonandClaude Opus 5.5 871174d214 feat(523-1): B07 설정 모달 공용 고침 — 끌기 닫힘 막음 · 폭 절반 · 그룹 상자 · 단추 줄 하나 · 자동 체크 없앰
- 공용 모달 바깥 누르기 = 누름 · 뗌 둘 다 배경일 때만 닫음(숫자 칸 끌기로 안 닫힘 · 평면도 ⚙ 포함 모든 openModal)
- ⚙ 설정 모달(종단 · 횡단 · 토적 · 구조물 · 전개도) 폭 720 → 360 px · 그룹 상자(legend) · 맨 아래 단추 줄 하나([안내선 숨기기] [기본값] [취소] [확인])
- [확인] = 바뀐 것만 저장(축척 → 배치) 뒤 다시 그림 · 붉은 칸이면 꺼짐 · 횡단 [이 장] [모든 장] [배율 적용] 단추 → 「적용」 고르기 + [확인]
- 축척 「자동」 체크 걷음 — 기본 = 지정값(종단 평면도 1/5,000 · 토적 X 1/2,000 · 전개도 X · Y 1/50) · 옛 null = 기본으로 읽음
- 낡은 시험 고침: 153-1(지운 buildCrossLayoutControls 대신 ⚙ 횡단 모달) · 212-3 · 180-3(안내선 단추 자리) · 280-5(자동 체크 · 단추 판정) · 485 축척 · 토적 · 종단 평면 칸(옛 자동 축척 값 → 지정 기본값)

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

79 lines
3.0 KiB
Python

# -*- coding: utf-8 -*-
"""153-1 · 523-1 B07 횡단 장 배치 — ⚙ 횡단 모달.
못박는 것
- 배치 칸 자리 = 「횡단도」 카드 ⚙ 모달(280-5) — 카드엔 ⚙ 하나 · 배치 칸 없음.
- 그룹 상자 「장 배치」(배치 열 · 행 · 적용) · 「표」(표 배율) · 공용 작은 칸(ui-input--sm).
- 단추 줄 = 맨 아래 하나([안내선 숨기기] [취소] [확인]) · 그 밖 단추 없음.
- [확인] = 바뀐 것만 저장 — 이 장만 · 모든 장(장마다 값 지움) · 표 배율만 · 손 안 대면 저장 없이 닫음.
- 범위 밖 = 칸 붉음 + [확인] 꺼짐 · 장이 아니면 적용 = 모든 장 하나 · [취소] = 그대로 닫음.
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):
card = out["card"]
assert card["gears"] == 1
assert card["layoutInCard"] == 0
assert card["settings"] == ["cross"]
def test_그룹_상자와_단추_줄_하나(out):
sheet = out["sheet"]
assert sheet["legends"] == ["장 배치", "표"]
assert sheet["labels"] == ["배치 열", "행", "적용", "표 배율"]
assert [i["value"] for i in sheet["inputs"]] == ["3", "4", "1"] # 지금 장(1장) 값
for field in sheet["inputs"][:2]:
assert field["type"] == "number" and field["min"] == "1" and field["max"] == "10"
table = sheet["inputs"][2]
assert (table["min"], table["max"], table["step"]) == ("0.5", "2", "0.1")
assert all("ui-input--sm" in field["cls"] for field in sheet["inputs"])
assert sheet["scope"] == {"options": ["이 장만", "모든 장"], "value": "sheet"}
assert sheet["footers"] == 1 and sheet["buttonsOutsideFooter"] == 0
assert sheet["footerButtons"] == ["안내선 숨기기", "취소", "확인"]
def test_확인은_바뀐_것만_저장(out):
assert out["applySheet"] == {
"saved": [[{"default": [4, 4], "sheets": {"1": [2, 5]}, "table_scale": 1}, 1]],
"closed": True,
}
assert out["applyAll"] == [[{"default": [3, 4], "sheets": {}, "table_scale": 1}, 1]]
assert out["applyTable"] == [
[{"default": [4, 4], "sheets": {"1": [3, 4]}, "table_scale": 1.5}, 1]
]
def test_범위_밖_장_아님_취소(out):
assert out["badGrid"] == {"disabled": True, "error": True, "saved": 0, "open": True}
assert out["badTable"] is True
assert out["notSheet"] == {
"options": ["모든 장"],
"values": ["4", "4", "1"],
"saved": 0,
"closed": True,
}
assert out["cancel"] == {"saved": 0, "closed": True}