36 lines
1.4 KiB
Python
36 lines
1.4 KiB
Python
from __future__ import annotations
|
|
|
|
from pathlib import Path
|
|
|
|
|
|
ROOT = Path(__file__).resolve().parents[2]
|
|
|
|
|
|
def test_frontend_wires_v1_workbench_status_strip() -> None:
|
|
app = (ROOT / "frontend" / "src" / "App.tsx").read_text(encoding="utf-8")
|
|
component = (ROOT / "frontend" / "src" / "components" / "WorkbenchStatusStrip.tsx").read_text(encoding="utf-8")
|
|
css = (ROOT / "frontend" / "src" / "styles" / "app.css").read_text(encoding="utf-8")
|
|
|
|
assert "WorkbenchStatusStrip" in app
|
|
assert "selectedProject={selectedProject}" in app
|
|
assert "qualityChecks={qualityChecks}" in app
|
|
assert "activeLayerFeatureCount={mapFeatureCount}" in app
|
|
assert "selectedAreaHasGeometry={Boolean(areaFeatureCollection)}" in app
|
|
assert "V1 readiness" in component
|
|
assert "Workbench status" in component
|
|
assert "Workbench has the core V1 loop populated." in component
|
|
assert "workbench-status-strip" in css
|
|
assert "status-tile-ready" in css
|
|
|
|
|
|
def test_workbench_status_strip_summarizes_existing_v1_loop_only() -> None:
|
|
component = (ROOT / "frontend" / "src" / "components" / "WorkbenchStatusStrip.tsx").read_text(encoding="utf-8")
|
|
|
|
assert "ProjectRead" in component
|
|
assert "AreaRead" in component
|
|
assert "DatasetCreateResponse" in component
|
|
assert "QualityCheckRead" in component
|
|
assert "ExportRead" in component
|
|
assert "fetch(" not in component
|
|
assert "api" not in component.lower()
|