From 82d2d762e31fed8b7053287e41c15602bd81902c Mon Sep 17 00:00:00 2001 From: Evan Rusackas Date: Sun, 5 Jul 2026 19:43:15 -0700 Subject: [PATCH] test(dashboard): fix filter-delete queries broken by aria-label rename #41742 changed the filter delete icon's accessible name from the alt text "delete" to aria-label "Remove filter" but did not update the two FiltersConfigModal tests querying the button by name, so sharded jest shard 5 fails on every PR. Update the role queries to the new name. Co-Authored-By: Claude Fable 5 --- .../FiltersConfigModal/FiltersConfigModal.test.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigModal.test.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigModal.test.tsx index 61941dad70cf..97ca7038a207 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigModal.test.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigModal.test.tsx @@ -974,7 +974,7 @@ test('restores a deleted filter via the "Restore filter" button', async () => { const filterContainer = screen.getByTestId('filter-title-container'); const firstTab = within(filterContainer).getAllByRole('tab')[0]; - fireEvent.click(within(firstTab).getByRole('button', { name: /delete/i })); + fireEvent.click(within(firstTab).getByRole('button', { name: /remove filter/i })); expect( await screen.findByText(/you have removed this filter/i), @@ -1009,7 +1009,7 @@ test('undoes a filter deletion via the sidebar "Undo?" link', async () => { const filterContainer = screen.getByTestId('filter-title-container'); const firstTab = within(filterContainer).getAllByRole('tab')[0]; - fireEvent.click(within(firstTab).getByRole('button', { name: /delete/i })); + fireEvent.click(within(firstTab).getByRole('button', { name: /remove filter/i })); const undoButton = await screen.findByTestId('undo-button'); expect(undoButton).toHaveTextContent(/undo\?/i);