fix: isolate regional project context
This commit is contained in:
@@ -132,3 +132,17 @@ def test_kempen_scope_operator_is_packaged_and_exposed_in_map_flow() -> None:
|
||||
assert 'aria-label="Regio"' in workspace
|
||||
assert "projects={projects}" in app
|
||||
assert "onSelectProject={selectProject}" in app
|
||||
|
||||
|
||||
def test_project_switches_reset_scoped_state_and_prefer_the_regional_context() -> None:
|
||||
bootstrap = (ROOT / "frontend/src/hooks/useWorkbenchBootstrap.ts").read_text(encoding="utf-8")
|
||||
project_workspace = (ROOT / "frontend/src/hooks/useProjectWorkspace.ts").read_text(encoding="utf-8")
|
||||
map_state = (ROOT / "frontend/src/hooks/useMapWorkspaceState.ts").read_text(encoding="utf-8")
|
||||
dataset_workflow = (ROOT / "frontend/src/hooks/useDatasetWorkflow.ts").read_text(encoding="utf-8")
|
||||
|
||||
selected_project_branch = bootstrap.split("if (!selectedProjectId)", maxsplit=1)[1]
|
||||
assert "resetProjectData()" in selected_project_branch
|
||||
assert "resetDatasetForProject()" in selected_project_branch
|
||||
assert "projectDataRequestSequence" in project_workspace
|
||||
assert "vervoerregio|operationele grens" in map_state
|
||||
assert "datasets.find(isOperationalScopeBoundaryDataset)" in dataset_workflow
|
||||
|
||||
Reference in New Issue
Block a user