diff --git a/src/search-modal/SearchUI.test.tsx b/src/search-modal/SearchUI.test.tsx index b566730baa..14593b6037 100644 --- a/src/search-modal/SearchUI.test.tsx +++ b/src/search-modal/SearchUI.test.tsx @@ -414,7 +414,9 @@ describe('', () => { const popupMenu = getByRole('group'); const problemFilterCheckbox = getByLabelTextIn(popupMenu, /Problem/i); fireEvent.click(problemFilterCheckbox, {}); - await waitFor(() => { expect(rendered.getByText('Type: Problem')).toBeInTheDocument(); }); + await waitFor(() => { + expect(rendered.getByRole('button', { name: /type: problem/i, hidden: true })).toBeInTheDocument(); + }); // Now wait for the filter to be applied and the new results to be fetched. await waitFor(() => { expect(fetchMock).toHaveFetchedTimes(3, searchEndpoint, 'post'); }); // Because we're mocking the results, there's no actual changes to the mock results,