Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tnajdek committed Sep 14, 2024
1 parent bb54f6e commit dac2a6c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
4 changes: 1 addition & 3 deletions test/basic-ui.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 0 additions & 1 deletion test/items.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit dac2a6c

Please sign in to comment.