Files
Aislo/resources/tester/test_635_3_b05_plan_panel.py
T
eomsangdonandClaude Opus 5.5 dfba0e7b57 feat(755-1·755-2): B05 예정노선 수정 — 켠 동안 판만 고침 · 끌 때 한 번 추적 · 재기 · 받은 노선 색 · 설명 · 위치 칸 걷음
- 755-1 켠 동안 끊김 허용(가운데 묶음 지움) · 고칠 때마다 다시 추적 걷음 · 끌 때 끊김 = 알림하고 안 끔 · 바뀜 = 확인창 → /route/follow 한 걸음 · 켠 동안 되돌리기 = 예정노선 판 사진첩(Ctrl+Z · 도구줄 단추 · bindHistoryControls local) · [잇기] 기능 표 b05 사용
- 755-2 켠 동안 재기 = D03 재기 겹(createPlanMeasure · 선 따라 · 두 점) · 받은 노선 = 분홍 점선 + 검은 테(기존 --draw-map-route-3 · theme.css 안 고침) · 켬 설명 걷음 · 위치 칸 걷음(기능 표 site b05 숨김 · 칸 자리 그리기 하나 · 찾기 이동 · toPlan 걷음)
- 낡은 시험 고침: test_626_3(되돌리기 = 판 사진첩 · join b05 사용) · test_635_3(칸 하나 · 위치 숨김 · 끌 때 한 번 · RouteEdit 줄 한도 683 → 690) · test_635_5(찾기 이동 걷음) · 새 지킴 시험 test_755_expected_flow

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 23:11:21 +09:00

78 lines
4.3 KiB
Python

"""635-3 B05 왼쪽 「그리기」 칸(755-2 위치 칸 걷음) · 「예정노선 수정」 · 받은 노선 비교 · [받은 노선으로] · 어둡게(요구 546).
- 칸 = 예정노선 키트(`createPlanKit` 「b05」) 칸 · 자리 = `registerPanelSection` order 1(종단 보기) · 편집기가 채움.
- 위치 칸 = 기능 표 「site」 b05 숨김(589-8) · 고칠 선 = 받은 원본 꼭짓점(`GET /route/plan/source` · 635-2).
- [받은 노선으로] = 받은 꼭짓점 다시 추적 + 초안 `expected` [](고친 예정노선 지움) — 한 걸음 · 페이지 [초기화] 그대로.
- 켬 = 아래 계획노선 그림 불투명 `--draw-map-dim`(0.35) · 등고 높이값 · 예정노선 그림은 그대로.
- 큰 파일 안 늘림(RouteEdit 690 · Render 648 + 10 안).
./venv/Scripts/python.exe -m pytest resources/tester/test_635_3_b05_plan_panel.py -q
"""
from __future__ import annotations
import re
from pathlib import Path
ROOT = Path(__file__).resolve().parents[2]
B05 = ROOT / "B05_Profile"
def _src(path: Path) -> str:
return path.read_text(encoding="utf-8")
def test_왼쪽_칸_하나_종단_보기_위():
panel = _src(B05 / "B05_Profile_UI_Panel_Plan.ts")
assert 'id: "plan-draw",' in panel and 'title: "그리기",' in panel and "order: 1," in panel
assert 'views: ["profile"]' in panel and '"site"' not in panel and '위치"' not in panel
assert "export function fillPlanPanel(" in panel
assert "holder.hidden = !card;" in panel # 비면 자리 숨김
# 다른 칸(구조물 배치 10 · 페이지 설정 20)보다 위
assert "order: 10" in _src(ROOT / "A00_Common" / "design" / "design_sections.ts")
assert "order: 20" in _src(B05 / "B05_Profile_UI_Panel_Sections.ts")
def test_키트_칸_위치_걷음_원본_꼭짓점():
ui = _src(B05 / "B05_Profile_UI_ExpectedDraw.ts")
body = ui.split("*/", 1)[1]
assert 'page: "b05",' in body and "cards: {}," in body
assert "fillPlanPanel(drawCard);" in body and "createPlaceFind" not in body
assert "toPlan" not in body and "frame" not in body # 찾기 이동 걷음(589-8)
for banned in ("createPlanTerrain", "ensureCovered", "createPlanSite", "createFloatPanel"):
assert banned not in body, banned
assert "/route/plan/source" in body and "expected_source" in body
assert "shown === original ? received() : shown" in body # 안 고친 선 = 원본 꼭짓점
features = _src(ROOT / "D03_PlanAnalysis" / "D03_PlanAnalysis_UI_Features.ts")
assert re.search(r'key: "site",[^}]*b05: "hide"', features, re.S)
assert re.search(r'key: "terrain",[^}]*b05: "hide"', features, re.S)
def test_수정_켬끔_받은_노선_비교_되돌림():
body = _src(B05 / "B05_Profile_UI_ExpectedDraw.ts").split("*/", 1)[1]
assert 'label: "예정노선 수정"' in body and 'label: "받은 노선"' in body
assert "drawCard.firstElementChild!.append(toggle.root);" in body # 그리기 칸 머리
assert "event.stopPropagation()" in body # 켬끔 누름 = 칸 접기 아님
assert "받은 노선 ${meters(received())} m → 고친 노선 ${meters(line())} m" in body
assert 'label: "받은 노선으로"' in body and "follow(received(), [])" in body
assert "resetButton.disabled = !edited || busy;" in body
assert "return sameLine(points, base) || (await follow(points, points));" in body # 끌 때 한 번
main = _src(B05 / "B05_Profile_UI_RouteEdit.ts")
assert "frame:" not in main
assert len(main.splitlines()) <= 690
def test_켬_때_아래_노선_어둡게():
body = _src(B05 / "B05_Profile_UI_ExpectedDraw.ts").split("*/", 1)[1]
assert 'dim: () => (open ? parseFloat(themeColor("--draw-map-dim", "0.35"))' in body
theme = _src(ROOT / "ui_template" / "ui_template_theme.css")
assert "--draw-map-dim: 0.35;" in theme
render = _src(B05 / "B05_Profile_UI_RouteEdit_Render.ts")
dim = render.index("context.globalAlpha = dim;\n drawFootprint(")
labels = render.index("context.globalAlpha = 1; // 등고 높이값")
top = render.index("context.globalAlpha = 1;\n scene.overAll?.paint(context);")
assert dim < render.index("scene.underRoute?.(context);") < labels < top # 추천 보기도 어둡게
assert render.index("drawStructureMarks(context, scene, line, style);") < top
assert len(render.splitlines()) <= 658
assert "overAll: expectedDraw," in _src(B05 / "B05_Profile_UI_RouteEdit.ts")