From dac2a6ca6234b1bc65c62b9e429ca10011404517 Mon Sep 17 00:00:00 2001 From: Tom Najdek Date: Sat, 14 Sep 2024 19:09:57 +0200 Subject: [PATCH] Fix tests --- test/basic-ui.test.jsx | 4 +--- test/items.test.jsx | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/test/basic-ui.test.jsx b/test/basic-ui.test.jsx index 2d2a85ae..adcb7d29 100644 --- a/test/basic-ui.test.jsx +++ b/test/basic-ui.test.jsx @@ -86,13 +86,11 @@ describe('Basic UI', () => { const searchBox = screen.getByRole('searchbox', { name: 'Title, Creator, Year' }); await user.type(searchBox, 'pathfinding'); - await waitFor(() => expect(searchBox).toHaveValue('pathfinding')); - await waitFor(() => expect(screen.getByText('7 items in this view')).toBeInTheDocument()); + await screen.findByText('7 items in this view', {}, { timeout: 5000 }); expect(await screen.findByRole('row', { name: 'Summary of pathfinding algorithms used in game development' })).toBeInTheDocument(); expect(screen.queryByRole('row', { name: 'Border Collie' })).not.toBeInTheDocument(); - const clearSearchButton = await screen.findByRole('button', { name: 'Clear Search' }); expect(clearSearchButton).toBeInTheDocument(); await user.click(clearSearchButton); diff --git a/test/items.test.jsx b/test/items.test.jsx index d093b68d..7bbde81a 100644 --- a/test/items.test.jsx +++ b/test/items.test.jsx @@ -378,7 +378,6 @@ describe('Items', () => { await user.type(searchBox, 'pathfinding'); await waitFor(() => expect(searchBox).toHaveValue('pathfinding')); - await waitFor(() => expect(screen.getByText('7 items in this view')).toBeInTheDocument()); const row = screen.getByRole('row', { name: 'A*-based pathfinding in modern computer games' }); const violetSwatch = getByRole(row, 'img', { name: 'violet circle icon' }); // position 1