From e485ab30f8db8962dc877dc32533d105524f8e32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=B4mulo=20Penido?= Date: Tue, 2 Jul 2024 12:20:54 -0300 Subject: [PATCH] test: fix search-modal locator --- src/search-modal/SearchUI.test.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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,