Fix Registration tests

environments/review-renovate-m-t65ngm/deployments/2154
Alex Gleason 2023-01-05 17:34:47 -06:00
rodzic b98073ee8f
commit 83c93a6d51
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
1 zmienionych plików z 10 dodań i 3 usunięć

Wyświetl plik

@ -30,7 +30,10 @@ describe('<Registration />', () => {
fireEvent.submit(screen.getByTestId('button'), { preventDefault: () => {} });
});
expect(screen.getByTestId('toast')).toHaveTextContent(/welcome to/i);
await waitFor(() => {
expect(screen.getByTestId('toast')).toHaveTextContent(/welcome to/i);
});
expect(screen.queryAllByRole('heading')).toHaveLength(0);
});
});
@ -47,7 +50,9 @@ describe('<Registration />', () => {
fireEvent.submit(screen.getByTestId('button'), { preventDefault: () => {} });
});
expect(screen.getByTestId('toast')).toHaveTextContent(/this username has already been taken/i);
await waitFor(() => {
expect(screen.getByTestId('toast')).toHaveTextContent(/this username has already been taken/i);
});
});
it('handles generic errors', async() => {
@ -61,7 +66,9 @@ describe('<Registration />', () => {
fireEvent.submit(screen.getByTestId('button'), { preventDefault: () => {} });
});
expect(screen.getByTestId('toast')).toHaveTextContent(/failed to register your account/i);
await waitFor(() => {
expect(screen.getByTestId('toast')).toHaveTextContent(/failed to register your account/i);
});
});
});