from __future__ import annotations from pathlib import Path ROOT = Path(__file__).resolve().parents[2] def test_demo_workflow_browser_smoke_script_checks_connected_v1_state() -> None: script = (ROOT / "scripts" / "verify_demo_export_workflow.sh").read_text(encoding="utf-8") assert "/api/v1/demo/workflow" in script assert "/api/v1/projects/${project_id}/areas" in script assert "/api/v1/projects/${project_id}/datasets" in script assert "/api/v1/projects/${project_id}/datasets/${candidate_dataset_id}/content" in script assert "/api/v1/projects/${project_id}/datasets/${candidate_dataset_id}/vector/summary" in script assert "GeoJSON Polygon/MultiPolygon geometry" in script assert "Candidate vector summary does not report persisted features" in script def test_frontend_demo_action_loads_candidate_dataset_details_for_map_layer() -> None: app = (ROOT / "frontend" / "src" / "App.tsx").read_text(encoding="utf-8") assert "const candidateDataset = projectData?.datasets.find" in app assert "dataset.id === result.candidate_dataset_id" in app assert "await loadDatasetDetails(result.project_id, candidateDataset)" in app