Files
Aislo/resources/tester/test_150_detail_pick.py
T
eomsangdonandClaude Opus 5.5 3898cb0019 refactor(380-1): 사토장 횡단 그림 · 사토 단면 셈 지움 — 부품 처음값 형상 · 3D 없음
- 부품 처음값 spoil_bank 형상 · 3D = none · 형상 부품 「사토(성토 채움)」 지움
- 사토 단면 셈 파이썬 · TS 짝 지움(Engine_SpoilFill · common_util_spoil_fill · spoil_fill 옵션 · fill_area_beyond)
- 카드 그림 · 면적표 줄 · 모달 띠 · 고름 선 · B07 표 「사토장」 칸 지움(빈 줄로 되돌림)
- B08 수량 · 유토 배분(haul-plan) 미사용 확인 · 남은 사토 값 = [저장] 서버 재계산 · 브라우저 단계 다시 셈으로 정리
- 시험 고쳐 씀: 322_1 · 349_0n · b06_spoil_fill_allocation(남은 값 정리) · spoil_fill_mirror(죽은 길) · 52_9 · cross_design_mirror · 150 · 164 · 179_4 · 316

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VmC34fsxxbweEG3RUjs3Mn
2026-10-17 14:56:42 +09:00

103 lines
4.0 KiB
Python

"""PLAN 150-4 — B06 [상세] 수량표 칸 누름 = 그림 복제 안 그 항목 강조.
짝: `B06_Section/B06_Section_UI_Cross_Detail_Pick.ts`(짝 표 · 구역) · `_UI_Cross_Detail.ts`(칸 키 · 누름).
실제 TS 를 `helper_150_detail_pick.cjs` 가 Node 로 돌린다.
"""
from __future__ import annotations
import json
import os
import subprocess
import pytest
from B07_DesignDetail.B07_DesignDetail_Engine_Cad_Table import QUANTITY_VALUE_KEYS
HERE = os.path.dirname(__file__)
ROOT = os.path.join(HERE, "..", "..")
pytestmark = pytest.mark.skipif(
not os.path.isdir(os.path.join(ROOT, "config", "node_modules")),
reason="프론트엔드 의존성 미설치",
)
# 늘 빈칸(`Engine_Cross_Quantity` 근거 없음) = 누름 없음
NO_PICK = {"fence", "grubbing", "topsoil_fill", "topsoil_cut"}
@pytest.fixture(scope="module")
def out() -> dict:
proc = subprocess.run( # noqa: S603 — 고정 실행 파일
["node", os.path.join(HERE, "helper_150_detail_pick.cjs")],
capture_output=True,
text=True,
encoding="utf-8",
timeout=60,
)
assert proc.returncode == 0, proc.stderr
return json.loads(proc.stdout)
def test_표_키_22_모두_짝_또는_누름_없음(out):
assert set(out["targets"]) | NO_PICK == set(QUANTITY_VALUE_KEYS)
assert not set(out["targets"]) & NO_PICK
def test_판정_선_구역(out):
assert out["zone"] == {
"road": "road",
"ditch": "ditch",
"cutSlope": "cut_slope",
"fillSlope": "fill",
}
def test_칸마다_그림_강조(out):
active = out["active"]
assert active["null"] == [] # 카드에서 묻어 온 강조도 지움
assert active["cut_soil"] == ["b06-chart__area--cut_soil"]
assert active["cut_rock"] == ["b06-chart__area--cut_rock"]
assert active["embankment"] == ["b06-chart__area--fill"]
assert "spoil_fill" not in out["targets"] # 사토장 횡단 그림 없음(380-1)
assert active["ground"] == ["b06-chart__center"]
assert active["ditch_soil"] == ["ditch"]
assert active["grading_cut"] == ["cutSlope"]
assert active["grading_fill"] == ["fillSlope"]
assert active["road_compaction"] == ["road"]
assert active["fence"] == []
def test_대상_있는_키만_빈칸은_빠짐(out):
"""164-2 — 그림에 대상이 없는 칸(암석 띠 없음)은 `data-empty`."""
assert out["present"] == sorted(out["targets"])
assert set(out["present"]) - set(out["presentBare"]) == {"cut_rock"}
def test_상세_표_칸_키_누름_배선():
with open(
os.path.join(ROOT, "B06_Section", "B06_Section_UI_Cross_Detail.ts"), encoding="utf-8"
) as f:
src = f.read()
assert "element.dataset.key = key" in src
# 259-2 — 저장 띠 출처면 그 띠 · 저장 조각이면 강조 없음(그래프 고름) · 값 칸(data-cell)도 누름
assert "highlightDetail(svg, state.section.design, band)" in src
assert 'closest<HTMLElement>("[data-key], [data-cell]")' in src
def test_상세_큰_창_공용_막_그림_글_표_순서():
"""150-2 — 투명 막 지움(밖 누르면 공용 닫기) · 큰 창 · 그림 → 글 → 표 · 스크롤 없음."""
base = os.path.join(ROOT, "B06_Section")
with open(os.path.join(base, "B06_Section_UI_Cross_Detail.ts"), encoding="utf-8") as f:
src = f.read()
with open(os.path.join(base, "B06_Section_UI_Style_Cross_Detail.css"), encoding="utf-8") as f:
css = f.read().replace(chr(13), "")
assert "wide: true" in src and "backdropClass" not in src
# 265-1 — 그림 → 표 → CAD 칸(글 칸 자리)
assert "body.append(cad, tableBox, noteBox)" in src
# 막 없음 — 259-3 표 강조 바깥 줄(누름 통과)만 pointer-events: none
backdrop = css.split(".b06-detail__pick-outline {")[0]
assert "pointer-events: none" not in backdrop and "b06-detail__backdrop" not in css
assert ".ui-modal.b06-detail > .ui-modal__body {\n overflow: hidden;" in css
assert "flex: 1;\n min-height: 0;" in css and "height: 100%;" in css # 173-4 칸 가득