"""PLAN 624-3 — B05 평면도에 공용 지도 부품(도구줄 표 · 겹 줄 · 범례 · 지형 칩)(요구 530 · 결정 A② · A③ · A⑦ · A⑨). - 도구줄 = 공용 표 「b05」 · 아래 줄 = 공용 겹 줄 · 범례 = 공용 `legendRows`. - 노선 띠 300 m 자르기 = B05 자기 칸(등고선 · 하천)만 · 그 밖 겹 = 안 자르는 둘째 GL 칸. - B05 화면 파일은 D03 파일을 안 부름 · 큰 파일은 안 늘어남. """ import re from pathlib import Path ROOT = Path(__file__).resolve().parents[2] B05 = ROOT / "B05_Profile" read = lambda path: path.read_text(encoding="utf-8") # noqa: E731 def test_도구줄_표_겹_줄_범례() -> None: chrome = read(B05 / "B05_Profile_UI_RouteEdit_Chrome.ts") assert 'mapToolGroups("b05", {' in chrome # 634-3 — 한 행 두 영역(왼쪽 겹 줄 · 오른쪽 도구줄) assert "createMapToolRow(layers.bar, mapTools.root)" in chrome assert "info.prepend(layers.legend)" in chrome layers = read(B05 / "B05_Profile_UI_RouteEdit_Layers.ts") assert 'page: "b05"' in layers and "legendRows(" in layers and "mapLayerSpecs(" in layers def test_띠_자르기는_등고선_하천만() -> None: gl = read(B05 / "B05_Profile_UI_RouteEdit_Gl.ts") assert "container.style.clipPath" in gl # B05 자기 칸(등고선 · 하천 · 1 m) assert 'gl.setVisible("contour", own.contour)' in gl assert 'gl.setVisible("sheets", own.stream)' in gl assert "layers.follow(meta, normalizer, toScreen" in gl layers = read(B05 / "B05_Profile_UI_RouteEdit_Layers.ts") assert "clipPath" not in layers # 공용 겹 칸은 안 자름 assert 'const OWN: readonly MapLayerKey[] = ["contour", "stream"]' in layers def test_처음_겹_숨긴_겹() -> None: src = read(ROOT / "A00_Common" / "map" / "map_layer_list.ts") b05 = re.search(r"b05: \{(.*?)\},", src, re.S).group(1) # 634-2 — 숨김 걷음(띠 · 임도(업로드) 보임 · 임도(업로드) = 받은 자료 없으면 막힘 + 까닭) assert "hide" not in b05 and 'on: ["contour", "stream"]' in b05 def test_D03_안_부름_파일_한도() -> None: for name in ( "B05_Profile_UI_RouteEdit_Layers.ts", "B05_Profile_UI_RouteEdit_Gl.ts", "B05_Profile_UI_RouteEdit_Chrome.ts", "B05_Profile_UI_RouteEdit_RecPreview.ts", "B05_Profile_UI_RouteEdit_Terrain.ts", ): src = read(B05 / name) assert "D03_PlanAnalysis" not in src, name assert len(src.splitlines()) <= 700, name assert len(read(B05 / "B05_Profile_UI_RouteEdit.ts").splitlines()) <= 694 d03 = read(ROOT / "D03_PlanAnalysis" / "D03_PlanAnalysis_Api.ts") assert 'export * from "../A00_Common/map/map_layer_api";' in d03