Skip to content

Commit

Permalink
fix: fix nudge password message copy on email sent success (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
mubbsharanwar authored Jun 13, 2024
1 parent 04dd340 commit 4903478
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/forms/reset-password-popup/forgot-password/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import ForgotPasswordFailureAlert from './ForgotPasswordFailureAlert';
import ForgotPasswordSuccess from './ForgotPasswordSuccess';
import { setCurrentOpenedForm } from '../../../authn-component/data/reducers';
import { InlineLink } from '../../../common-ui';
import { COMPLETE_STATE, LOGIN_FORM } from '../../../data/constants';
import { COMPLETE_STATE, DEFAULT_STATE, LOGIN_FORM } from '../../../data/constants';
import { useDispatch, useSelector } from '../../../data/storeHooks';
import {
forgotPasswordPageViewedEvent,
Expand Down Expand Up @@ -94,7 +94,7 @@ const ForgotPasswordForm = () => {
<Container size="lg" className="authn__popup-container overflow-auto">
<ResetPasswordHeader />
<ForgotPasswordFailureAlert emailError={formErrors} status={status} />
{loginErrorCode === REQUIRE_PASSWORD_CHANGE && (
{status === DEFAULT_STATE && loginErrorCode === REQUIRE_PASSWORD_CHANGE && (
<p
aria-live="assertive"
tabIndex="-1"
Expand All @@ -104,7 +104,7 @@ const ForgotPasswordForm = () => {
{formatMessage(messages.vulnerablePasswordBlockedMessage)}
</p>
)}
{loginErrorCode === NUDGE_PASSWORD_CHANGE && (
{status === DEFAULT_STATE && loginErrorCode === NUDGE_PASSWORD_CHANGE && (
<p
tabIndex="-1"
aria-live="assertive"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { MemoryRouter } from 'react-router-dom';
import configureStore from 'redux-mock-store';

import { setCurrentOpenedForm } from '../../../../authn-component/data/reducers';
import { COMPLETE_STATE, LOGIN_FORM } from '../../../../data/constants';
import { COMPLETE_STATE, DEFAULT_STATE, LOGIN_FORM } from '../../../../data/constants';
import { AuthnContext } from '../../../../data/storeHooks';
import { NUDGE_PASSWORD_CHANGE, REQUIRE_PASSWORD_CHANGE } from '../../../login-popup/data/constants';
import { loginErrorClear } from '../../../login-popup/data/reducers';
Expand All @@ -24,7 +24,7 @@ const initialState = {
},
},
forgotPassword: {
status: '',
status: DEFAULT_STATE,
},
};

Expand Down Expand Up @@ -190,6 +190,9 @@ describe('ForgotPasswordPage', () => {
errorCode: REQUIRE_PASSWORD_CHANGE,
},
},
forgotPassword: {
status: DEFAULT_STATE,
},
});

const { getByTestId } = render(reduxWrapper(<IntlForgotPasswordPage />));
Expand Down

0 comments on commit 4903478

Please sign in to comment.