-
-
Notifications
You must be signed in to change notification settings - Fork 712
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Restore password check functionality (#1392)
* Restore password check functionality * fix failing test
- Loading branch information
Showing
4 changed files
with
278 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -175,8 +175,8 @@ describe('Testing Login Page Screen', () => { | |
firstName: 'John', | ||
lastName: 'Doe', | ||
email: '[email protected]', | ||
password: 'johndoe', | ||
confirmPassword: 'johndoe', | ||
password: 'John@123', | ||
confirmPassword: 'John@123', | ||
}; | ||
|
||
render( | ||
|
@@ -215,13 +215,57 @@ describe('Testing Login Page Screen', () => { | |
userEvent.click(screen.getByTestId('registrationBtn')); | ||
}); | ||
|
||
test('Testing registration functionality when all inputs are invalid', async () => { | ||
const formData = { | ||
firstName: '1234', | ||
lastName: '8890', | ||
email: '[email protected]', | ||
password: 'john@123', | ||
confirmPassword: 'john@123', | ||
}; | ||
|
||
render( | ||
<MockedProvider addTypename={false} link={link}> | ||
<BrowserRouter> | ||
<Provider store={store}> | ||
<I18nextProvider i18n={i18nForTest}> | ||
<LoginPage /> | ||
</I18nextProvider> | ||
</Provider> | ||
</BrowserRouter> | ||
</MockedProvider> | ||
); | ||
|
||
await wait(); | ||
|
||
userEvent.click(screen.getByTestId(/goToRegisterPortion/i)); | ||
|
||
await wait(); | ||
|
||
userEvent.type( | ||
screen.getByPlaceholderText(/First Name/i), | ||
formData.firstName | ||
); | ||
userEvent.type( | ||
screen.getByPlaceholderText(/Last name/i), | ||
formData.lastName | ||
); | ||
userEvent.type(screen.getByTestId(/signInEmail/i), formData.email); | ||
userEvent.type(screen.getByPlaceholderText('Password'), formData.password); | ||
userEvent.type( | ||
screen.getByPlaceholderText('Confirm Password'), | ||
formData.confirmPassword | ||
); | ||
userEvent.click(screen.getByTestId('registrationBtn')); | ||
}); | ||
|
||
test('Testing registration functionality, when password and confirm password is not same', async () => { | ||
const formData = { | ||
firstName: 'John', | ||
lastName: 'Doe', | ||
email: '[email protected]', | ||
password: 'johndoe', | ||
confirmPassword: 'doeJohn', | ||
password: 'johnDoe@1', | ||
confirmPassword: 'doeJohn@2', | ||
}; | ||
|
||
render( | ||
|
Oops, something went wrong.