kopia lustrzana https://gitlab.com/soapbox-pub/soapbox
Fix Registration tests
rodzic
b98073ee8f
commit
83c93a6d51
|
@ -30,7 +30,10 @@ describe('<Registration />', () => {
|
||||||
fireEvent.submit(screen.getByTestId('button'), { preventDefault: () => {} });
|
fireEvent.submit(screen.getByTestId('button'), { preventDefault: () => {} });
|
||||||
});
|
});
|
||||||
|
|
||||||
|
await waitFor(() => {
|
||||||
expect(screen.getByTestId('toast')).toHaveTextContent(/welcome to/i);
|
expect(screen.getByTestId('toast')).toHaveTextContent(/welcome to/i);
|
||||||
|
});
|
||||||
|
|
||||||
expect(screen.queryAllByRole('heading')).toHaveLength(0);
|
expect(screen.queryAllByRole('heading')).toHaveLength(0);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -47,8 +50,10 @@ describe('<Registration />', () => {
|
||||||
fireEvent.submit(screen.getByTestId('button'), { preventDefault: () => {} });
|
fireEvent.submit(screen.getByTestId('button'), { preventDefault: () => {} });
|
||||||
});
|
});
|
||||||
|
|
||||||
|
await waitFor(() => {
|
||||||
expect(screen.getByTestId('toast')).toHaveTextContent(/this username has already been taken/i);
|
expect(screen.getByTestId('toast')).toHaveTextContent(/this username has already been taken/i);
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
it('handles generic errors', async() => {
|
it('handles generic errors', async() => {
|
||||||
__stub(mock => {
|
__stub(mock => {
|
||||||
|
@ -61,9 +66,11 @@ describe('<Registration />', () => {
|
||||||
fireEvent.submit(screen.getByTestId('button'), { preventDefault: () => {} });
|
fireEvent.submit(screen.getByTestId('button'), { preventDefault: () => {} });
|
||||||
});
|
});
|
||||||
|
|
||||||
|
await waitFor(() => {
|
||||||
expect(screen.getByTestId('toast')).toHaveTextContent(/failed to register your account/i);
|
expect(screen.getByTestId('toast')).toHaveTextContent(/failed to register your account/i);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
describe('validations', () => {
|
describe('validations', () => {
|
||||||
it('should undisable button with valid password', async() => {
|
it('should undisable button with valid password', async() => {
|
||||||
|
|
Ładowanie…
Reference in New Issue