Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions client/src/components/ReviewForm.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ it.each([
expect(status).toHaveTextContent(
review ? 'Your review was updated.' : 'Your review was published.',
);
expect(status).toHaveFocus();
await waitFor(() => expect(status).toHaveFocus());
expect(result).toHaveBeenCalledOnce();
expect(onChanged).toHaveBeenCalledOnce();
expect(button).toHaveAttribute('aria-disabled', review ? 'true' : 'false');
Expand Down Expand Up @@ -221,7 +221,7 @@ it('deletes an existing review and clears the form', async () => {
await act(async () => finishRefresh());
const status = await screen.findByRole('status');
expect(status).toHaveTextContent('Your review was deleted.');
expect(status).toHaveFocus();
await waitFor(() => expect(status).toHaveFocus());
expect(onChanged).toHaveBeenCalledOnce();
expect(result).toHaveBeenCalledOnce();
expect(button).toHaveAttribute('aria-disabled', 'false');
Expand Down Expand Up @@ -303,7 +303,7 @@ it.each(['publish', 'update', 'delete'])(
? 'Your review was published.'
: 'Your review was updated.',
);
expect(status).toHaveFocus();
await waitFor(() => expect(status).toHaveFocus());
expect(onChanged).toHaveBeenCalledOnce();
expect(screen.queryByRole('alert')).not.toBeInTheDocument();
},
Expand Down