- {formatHTML(t('idv.failure.exceptions.text_html', { link: `` }), { - a() { - return ( - - {t('idv.failure.exceptions.link')} - - ); - }, - })} -
- - ); -} - -export default ErrorStatusPage; diff --git a/app/javascript/packages/verify-flow/hooks/use-initial-step-validation.spec.ts b/app/javascript/packages/verify-flow/hooks/use-initial-step-validation.spec.ts deleted file mode 100644 index 29bf0f2f0d1..00000000000 --- a/app/javascript/packages/verify-flow/hooks/use-initial-step-validation.spec.ts +++ /dev/null @@ -1,69 +0,0 @@ -import sinon from 'sinon'; -import { renderHook } from '@testing-library/react-hooks'; -import { useDefineProperty } from '@18f/identity-test-helpers'; -import { FormStep } from '@18f/identity-form-steps'; -import useInitialStepValidation from './use-initial-step-validation'; - -const TEST_BASE_PATH = '/step/'; -const STEPS = [{ name: 'one' }, { name: 'two' }, { name: 'three' }] as FormStep[]; - -describe('useInitialStepValidation', () => { - const defineProperty = useDefineProperty(); - - context('with no path param', () => { - beforeEach(() => { - defineProperty(window, 'location', { - value: { - pathname: TEST_BASE_PATH, - }, - }); - }); - - it('returns the first step', () => { - const { result } = renderHook(() => useInitialStepValidation(TEST_BASE_PATH, STEPS)); - const [initialStep] = result.current; - - expect(initialStep).to.equal(STEPS[0].name); - }); - }); - - context('with path param exceeding progress', () => { - beforeEach(() => { - defineProperty(window, 'location', { - value: { - pathname: TEST_BASE_PATH + STEPS[1].name, - }, - }); - }); - - it('returns furthest step progress', () => { - const { result } = renderHook(() => useInitialStepValidation(TEST_BASE_PATH, STEPS)); - const [initialStep] = result.current; - - expect(initialStep).to.equal(STEPS[0].name); - }); - }); - - context('with path param not exceeding progress', () => { - beforeEach(() => { - defineProperty(window, 'location', { - value: { - pathname: TEST_BASE_PATH + STEPS[1].name, - }, - }); - - defineProperty(global, 'sessionStorage', { - value: { - getItem: sinon.stub().withArgs('completedStep').returns(STEPS[0].name), - }, - }); - }); - - it('returns path param', () => { - const { result } = renderHook(() => useInitialStepValidation(TEST_BASE_PATH, STEPS)); - const [initialStep] = result.current; - - expect(initialStep).to.equal(STEPS[1].name); - }); - }); -}); diff --git a/app/javascript/packages/verify-flow/hooks/use-initial-step-validation.ts b/app/javascript/packages/verify-flow/hooks/use-initial-step-validation.ts deleted file mode 100644 index d11bd2fb928..00000000000 --- a/app/javascript/packages/verify-flow/hooks/use-initial-step-validation.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { useMemo } from 'react'; -import type { Dispatch } from 'react'; -import { FormStep, getStepParam } from '@18f/identity-form-steps'; -import useSessionStorage from './use-session-storage'; - -/** - * Returns the index of the given step name in the form steps order. - * - * @param stepName Step name. - * @param steps Steps order. - * - * @return Step index. - */ -const getStepIndex = (stepName: string, steps: FormStep[]) => - steps.findIndex((step) => step.name === stepName); - -/** - * React hook which validates the expected initial step to present the user, based on past - * completion and presence of a URL path fragment. Behaves similar to a useState hook, where the - * return value is a tuple of the validated initial step, and a setter for assigning a completed - * step. - * - * @param basePath Path to which the current step is appended to create the current step URL. - * @param steps Steps order. - * - * @return Tuple of the validated initial step and a setter for assigning a completed step. - */ -function useInitialStepValidation( - basePath: string, - steps: FormStep[], -): [string, Dispatch{t('idv.messages.sessions.review_message', { app_name: appName })}
-- - {t('idv.messages.sessions.read_more_encrypt', { app_name: appName })} - -
-{t('instructions.personal_key.info')}
-- {formatHTML( - t('users.personal_key.generated_on_html', { - date: `${new Intl.DateTimeFormat([], { - dateStyle: 'long', - }).format()}`, - }), - { strong: 'strong' }, - )} -
-- {t('instructions.personal_key.email_title')} -
-{t('instructions.personal_key.email_body')}
-