diff --git a/src/components/pages/forgot-password/__tests__/__snapshots__/forgot-password-form.tsx.snap b/src/components/pages/forgot-password/__tests__/__snapshots__/forgot-password-form.tsx.snap
index f84cfac364..3ecc5f9f6f 100644
--- a/src/components/pages/forgot-password/__tests__/__snapshots__/forgot-password-form.tsx.snap
+++ b/src/components/pages/forgot-password/__tests__/__snapshots__/forgot-password-form.tsx.snap
@@ -61,3 +61,28 @@ exports[`ForgotPasswordForm should match snapshot 2`] = `
`;
+
+exports[`ForgotPasswordForm should match snapshot 3`] = ``;
+
+exports[`SuccessForgetPasswordContent should match snapshot 1`] = `
+
+
+ Success
+
+
+ Please check your inbox for an email we have just sent you with instructions for how to reset your password.
+
+
+
+ Click here to return to the login page
+
+
+`;
diff --git a/src/components/pages/forgot-password/__tests__/forgot-password-form.tsx b/src/components/pages/forgot-password/__tests__/forgot-password-form.tsx
index cc50bb7d7d..3724a84eff 100644
--- a/src/components/pages/forgot-password/__tests__/forgot-password-form.tsx
+++ b/src/components/pages/forgot-password/__tests__/forgot-password-form.tsx
@@ -7,7 +7,8 @@ import {
mapPropsToValues,
ForgotPasswordValues,
handleSubmitForgotPassword,
- ForgotPasswordFormProps
+ ForgotPasswordFormProps,
+ SuccessForgetPasswordContent
} from '../forgot-password-form'
describe('ForgotPasswordForm', () => {
@@ -38,6 +39,22 @@ describe('ForgotPasswordForm', () => {
expect(wrapper.find('[dataTest="email"]')).toHaveLength(1)
})
+ it('should match snapshot', () => {
+ const mockProps = {
+ ...mockWithFormik({ email: '1' }),
+ ...getMockRouterProps({}),
+ location: {
+ hash: '',
+ key: '',
+ pathname: '',
+ search: '?isSuccess=1',
+ state: {}
+ }
+ } as ForgotPasswordFormProps
+ const wrapper = shallow()
+ expect(wrapper).toMatchSnapshot()
+ })
+
describe('mapPropsToValues', () => {
it('should run correctly', () => {
const result = mapPropsToValues()
@@ -72,3 +89,10 @@ describe('ForgotPasswordForm', () => {
})
})
})
+
+describe('SuccessForgetPasswordContent', () => {
+ it('should match snapshot', () => {
+ const wrapper = shallow()
+ expect(wrapper).toMatchSnapshot()
+ })
+})
diff --git a/src/components/pages/forgot-password/forgot-password-form.tsx b/src/components/pages/forgot-password/forgot-password-form.tsx
index eb5316614f..9db56d9702 100644
--- a/src/components/pages/forgot-password/forgot-password-form.tsx
+++ b/src/components/pages/forgot-password/forgot-password-form.tsx
@@ -11,9 +11,25 @@ import {
Form,
withFormik,
FormikProps,
- FormikBag
+ FormikBag,
+ H5,
+ FlexContainerBasic
} from '@reapit/elements'
import { withRouter, RouteComponentProps } from 'react-router'
+import { Link } from 'react-router-dom'
+
+export const SuccessForgetPasswordContent: React.FC = () => {
+ return (
+
+
Success
+
+ Please check your inbox for an email we have just sent you with instructions for how to reset your password.
+
+
+ Click here to return to the login page
+
+ )
+}
export type ForgotPasswordFormProps = FormikProps & RouteComponentProps
@@ -24,6 +40,10 @@ export const ForgotPasswordForm: React.FC = ({
location
}) => {
const isError = location.search === '?isError=1'
+ const isSuccess = location.search === '?isSuccess=1'
+ if (isSuccess) {
+ return
+ }
return (