Skip to content

test: add e2e anvil-cmg test for filter persistence across navigation and export #4791

@frano-m

Description

@frano-m

Summary

Add an e2e test for anvil-cmg that verifies filter state is preserved across navigation flows. This covers a regression where moving providers inside the ErrorBoundary caused state loss during route transitions (see #4783, #4787).

Test flow

  1. Navigate to the Datasets page
  2. Select two filters from different categories
  3. Verify the URL contains the correct filter params and the filter tags display
  4. Navigate to a dataset detail page
  5. Return back to the Datasets page
  6. Verify the URL still contains the correct filter params and the filter tags still display
  7. Navigate to the Export/Explore page (via the Export button)
  8. Verify the URL is correct
  9. In the side panel, under "Current Query", verify both filter facet names and their selected terms render

Context

Recent commits (#4783, #4787) moved ExploreStateProvider inside the ErrorBoundary to prevent crash loops, but this caused filter state to be lost on navigation. The root cause was the dynamic Main component (derived from Component.Main) changing identity across routes, causing React to unmount and remount everything inside it — including the state providers.

This e2e test ensures the filter-URL-navigation flow remains stable.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions