Skip to content
This repository has been archived by the owner on Nov 21, 2024. It is now read-only.

fix: message shown on the button when reset is success #489

Merged
merged 2 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions cypress/e2e/resetPassword.cy.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { RESET_PASSWORD_PATH } from '../../src/config/paths';
import {
RESET_PASSWORD_BACK_TO_LOGIN_BUTTON_ID,
RESET_PASSWORD_ERROR_MESSAGE_ID,
RESET_PASSWORD_NEW_PASSWORD_CONFIRMATION_FIELD_ERROR_TEXT_ID,
RESET_PASSWORD_NEW_PASSWORD_CONFIRMATION_FIELD_ID,
Expand Down Expand Up @@ -31,6 +32,10 @@ describe('Reset password', () => {
);
cy.get(`#${RESET_PASSWORD_SUBMIT_BUTTON_ID}`).click();
cy.get(`#${RESET_PASSWORD_SUCCESS_MESSAGE_ID}`).should('be.visible');
cy.get(`#${RESET_PASSWORD_BACK_TO_LOGIN_BUTTON_ID}`).should(
'contain.text',
'Back to sign in',
spaenleh marked this conversation as resolved.
Show resolved Hide resolved
);
});

it('With weak password', () => {
Expand Down
4 changes: 3 additions & 1 deletion src/components/requestPasswordReset/ResetPassword.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { useAuthTranslation } from '../../config/i18n';
import { REQUEST_PASSWORD_RESET_PATH, SIGN_IN_PATH } from '../../config/paths';
import { mutations } from '../../config/queryClient';
import {
RESET_PASSWORD_BACK_TO_LOGIN_BUTTON_ID,
RESET_PASSWORD_ERROR_MESSAGE_ID,
RESET_PASSWORD_NEW_PASSWORD_CONFIRMATION_FIELD_ERROR_TEXT_ID,
RESET_PASSWORD_NEW_PASSWORD_CONFIRMATION_FIELD_ID,
Expand Down Expand Up @@ -200,8 +201,9 @@ const ResetPassword = () => {
fullWidth
component={Link}
to={SIGN_IN_PATH}
id={RESET_PASSWORD_BACK_TO_LOGIN_BUTTON_ID}
>
{t(AUTH.RESET_PASSWORD_ERROR_TRY_AGAIN)}
{t(AUTH.BACK_TO_SIGN_IN_BUTTON)}
</Button>
</>
) : (
Expand Down
2 changes: 2 additions & 0 deletions src/config/selectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ export const RESET_PASSWORD_NEW_PASSWORD_FIELD_ERROR_TEXT_ID =
'resetPasswordNewPasswordErrorText';
export const RESET_PASSWORD_NEW_PASSWORD_CONFIRMATION_FIELD_ERROR_TEXT_ID =
'resetPasswordNewPasswordConfirmationErrorText';
export const RESET_PASSWORD_BACK_TO_LOGIN_BUTTON_ID =
'resetPasswordBackToLoginButton';

export const PASSWORD_SIGN_IN_FIELD_ID = 'passwordSignInField';
export const PASSWORD_SIGN_IN_BUTTON_ID = 'passwordSignInButton';
Expand Down