Skip to content

test(e2e): Add Playwright test for time range pre-filter visibility based on dataset columns #36964

@sadpandajoe

Description

@sadpandajoe

Summary

Add a Playwright E2E test to verify that the time range pre-filter option is hidden when a dataset has no temporal columns.

Background

This test scenario was originally implemented as a Jest/RTL unit test in FiltersConfigModal.test.tsx but was skipped in September 2021 (PR #16906) due to flakiness. After 11 fix attempts, it was determined that this scenario cannot be reliably tested at the unit test level due to:

  1. The modal architecture requires complex Redux + API mock coordination
  2. showTimeRangePicker depends on loadedDatasets populated by async API fetch during mount
  3. Timing issues between state updates and component rendering create race conditions

The underlying logic is now covered by unit tests for shouldShowTimeRangePicker and hasTemporalColumns in utils.test.ts.

Test Scenario

  1. Create/edit a filter with a dataset that has no temporal columns (only String, Numeric, Boolean types)
  2. Open the filter configuration modal
  3. Navigate to the Settings tab
  4. Enable the pre-filter checkbox
  5. Verify: The time range pre-filter option should NOT be shown

Acceptance Criteria

  • Playwright test covers the scenario described above
  • Test uses a dataset fixture with column_types containing no GenericDataType.Temporal (value 2)
  • Test is stable and not flaky

Related

Metadata

Metadata

Assignees

Labels

explore:filterRelated to filters in Explore

Type

No type

Projects

Status

Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions