60 lines
2.5 KiB
Python
60 lines
2.5 KiB
Python
from __future__ import annotations
|
|
|
|
from pathlib import Path
|
|
|
|
|
|
ROOT = Path(__file__).resolve().parents[2]
|
|
|
|
|
|
def test_map_workspace_exposes_structured_surfaces() -> None:
|
|
map_workspace = (ROOT / "frontend" / "src" / "components" / "map" / "MapWorkspace.tsx").read_text(
|
|
encoding="utf-8"
|
|
)
|
|
|
|
assert 'className="map-workspace-shell"' in map_workspace
|
|
assert 'className="map-context-summary"' in map_workspace
|
|
assert 'aria-label="Status van de kaartlagen"' in map_workspace
|
|
assert 'className="map-control-surface"' in map_workspace
|
|
assert 'aria-label="Bediening van de kaartwerkruimte"' in map_workspace
|
|
assert 'className="map-frame-surface"' in map_workspace
|
|
assert 'className="map-inspection-surface"' in map_workspace
|
|
|
|
|
|
def test_map_workspace_summary_uses_current_layer_and_selection_state() -> None:
|
|
map_workspace = (ROOT / "frontend" / "src" / "components" / "map" / "MapWorkspace.tsx").read_text(
|
|
encoding="utf-8"
|
|
)
|
|
|
|
assert "const selectedMapArea = areas.find" in map_workspace
|
|
assert "selectedMapArea?.name ?? 'Geen gebied geselecteerd'" in map_workspace
|
|
assert "mapLayerLabel" in map_workspace
|
|
assert "mapLayerSourceLabel" in map_workspace
|
|
assert "mapFeatureCount" in map_workspace
|
|
assert "areaFeatureCount" in map_workspace
|
|
|
|
|
|
def test_map_workspace_density_css_contracts() -> None:
|
|
css = (ROOT / "frontend" / "src" / "styles" / "app.css").read_text(encoding="utf-8")
|
|
|
|
assert ".map-workspace-shell" in css
|
|
assert ".map-context-summary" in css
|
|
assert ".map-context-summary > div" in css
|
|
assert ".map-control-surface" in css
|
|
assert ".map-frame-surface" in css
|
|
assert ".map-inspection-surface" in css
|
|
assert ".map-workspace-shell .map-toolbar" in css
|
|
assert "grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));" in css
|
|
assert "background: linear-gradient(180deg, #ffffff, #f7fbf8);" in css
|
|
assert "border-left: 4px solid var(--accent);" in css
|
|
|
|
|
|
def test_map_workspace_mobile_controls_remain_compact() -> None:
|
|
css = (ROOT / "frontend" / "src" / "styles" / "app.css").read_text(encoding="utf-8")
|
|
|
|
assert ".map-workspace-shell .map-context-summary" in css
|
|
assert ".map-workspace-shell .map-toolbar" in css
|
|
assert ".map-workspace-shell .layer-provenance-rail" in css
|
|
assert "grid-template-columns: repeat(auto-fit, minmax(8.25rem, 1fr));" in css
|
|
assert "grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));" in css
|
|
assert ".map-control-surface," in css
|