Skip to content

Commit

Permalink
Restore password check functionality (#1392)
Browse files Browse the repository at this point in the history
* Restore password check functionality

* fix failing test
  • Loading branch information
meetulr authored Jan 6, 2024
1 parent 898455c commit ee31524
Show file tree
Hide file tree
Showing 4 changed files with 278 additions and 41 deletions.
26 changes: 22 additions & 4 deletions src/screens/LoginPage/LoginPage.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@
height: 5rem;
width: 5rem;
display: block;
margin: 1rem auto;
margin-top: 30px;
margin: 1.5rem auto 1rem;
-webkit-animation: zoomIn 0.3s ease-in-out;
animation: zoomIn 0.3s ease-in-out;
}
Expand Down Expand Up @@ -132,8 +131,8 @@
}

.row .right_portion .talawa_logo {
height: 80px;
margin: 1rem auto 0.5rem auto;
height: 120px;
margin: 0 auto 2rem auto;
}

.socialIcons {
Expand Down Expand Up @@ -207,3 +206,22 @@
gap: 16px;
justify-content: center;
}

.password_checks {
display: flex;
justify-content: space-between;
align-items: flex-start;
flex-direction: column;
}

.password_check_element {
margin-top: -10px;
}

.password_check_element_top {
margin-top: 18px;
}

.password_check_element_bottom {
margin-bottom: -20px;
}
52 changes: 48 additions & 4 deletions src/screens/LoginPage/LoginPage.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down
Loading

0 comments on commit ee31524

Please sign in to comment.