Skip to content

Commit

Permalink
test: Improve stability of 'check error details' test
Browse files Browse the repository at this point in the history
This adds awaiting to a few expects, hopefully improving the stability of the test.
  • Loading branch information
regexowl authored and ezr-ondrej committed Jul 23, 2024
1 parent eb2cfe9 commit 16422e9
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions src/test/Components/ImagesTable/ImagesTable.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,9 @@ describe('Images Table', () => {

await user.click(errorPopoverR2);
await screen.findByTestId('errorstatus-popover');
expect(screen.getAllByText(/Error in depsolve job/i)[0]).toBeVisible();
await waitFor(() =>
expect(screen.getAllByText(/Error in depsolve job/i)[0]).toBeVisible()
);
await user.click(errorPopoverR2);
await waitFor(() =>
expect(
Expand All @@ -164,7 +166,9 @@ describe('Images Table', () => {

await user.click(errorPopoverR7);
await screen.findByTestId('errorstatus-popover');
expect(screen.getAllByText(/Error in depsolve job/i)[0]).toBeVisible();
await waitFor(() =>
expect(screen.getAllByText(/Error in depsolve job/i)[0]).toBeVisible()
);
await user.click(errorPopoverR7);
await waitFor(() =>
expect(
Expand Down Expand Up @@ -202,10 +206,14 @@ describe('Images Table', () => {

await user.click(errorPopoverP2R6);
await screen.findByTestId('errorstatus-popover');
expect(
screen.getAllByText(/Something went very wrong for Azure/i)[0]
).toBeVisible();
expect(screen.getAllByText(/There was an error/i)[0]).toBeVisible();
await waitFor(() =>
expect(
screen.getAllByText(/Something went very wrong for Azure/i)[0]
).toBeVisible()
);
await waitFor(() =>
expect(screen.getAllByText(/There was an error/i)[0]).toBeVisible()
);
});
});

Expand Down

0 comments on commit 16422e9

Please sign in to comment.