Fix SmsVerification tests

environments/review-renovate-m-t65ngm/deployments/2154
Alex Gleason 2 years ago
parent bd9bad9a4c
commit fd542d1796
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7

@ -37,8 +37,10 @@ describe('<SmsVerification />', () => {
);
});
await waitFor(() => {
expect(screen.getByRole('heading')).toHaveTextContent('Verification code');
expect(screen.getByTestId('toast')).toHaveTextContent('A verification code has been sent to your phone number.');
});
act(() => {
toast.remove();
@ -68,8 +70,10 @@ describe('<SmsVerification />', () => {
);
});
await waitFor(() => {
expect(screen.getByRole('heading')).toHaveTextContent('Verification code');
expect(screen.getByTestId('toast')).toHaveTextContent('A verification code has been sent to your phone number.');
});
act(() => {
toast.remove();
@ -82,9 +86,11 @@ describe('<SmsVerification />', () => {
await userEvent.type(screen.getByLabelText('Digit 5'), '5');
await userEvent.type(screen.getByLabelText('Digit 6'), '6');
await waitFor(() => {
expect(screen.getByTestId('toast')).toHaveTextContent('Your SMS token has expired.');
});
});
});
describe('with invalid data', () => {
beforeEach(() => {
@ -106,7 +112,9 @@ describe('<SmsVerification />', () => {
);
});
await waitFor(() => {
expect(screen.getByTestId('toast')).toHaveTextContent('Failed to send SMS message to your phone number.');
});
});
});
});

Loading…
Cancel
Save