diff --git a/app/javascript/packages/document-capture/components/in-person-call-to-action.spec.tsx b/app/javascript/packages/document-capture/components/in-person-call-to-action.spec.tsx index d5e72f792a0..e5879ddf146 100644 --- a/app/javascript/packages/document-capture/components/in-person-call-to-action.spec.tsx +++ b/app/javascript/packages/document-capture/components/in-person-call-to-action.spec.tsx @@ -20,8 +20,8 @@ describe('InPersonCallToAction', () => { , ); - const link = getByRole('link', { name: 'in_person_proofing.body.cta.button' }); - await userEvent.click(link); + const button = getByRole('button', { name: 'in_person_proofing.body.cta.button' }); + await userEvent.click(button); expect(trackEvent).to.have.been.calledWith( 'IdV: verify in person troubleshooting option clicked', diff --git a/app/javascript/packages/document-capture/components/in-person-call-to-action.tsx b/app/javascript/packages/document-capture/components/in-person-call-to-action.tsx index 52c242153fa..61625ca68fc 100644 --- a/app/javascript/packages/document-capture/components/in-person-call-to-action.tsx +++ b/app/javascript/packages/document-capture/components/in-person-call-to-action.tsx @@ -2,6 +2,7 @@ import { useContext } from 'react'; import { Button } from '@18f/identity-components'; import { useInstanceId } from '@18f/identity-react-hooks'; import { t } from '@18f/identity-i18n'; +import useHistoryParam from '@18f/identity-form-steps/use-history-param'; import AnalyticsContext from '../context/analytics'; import { InPersonContext } from '../context'; @@ -15,6 +16,7 @@ function InPersonCallToAction({ altHeading, altPrompt, altButtonText }: InPerson const instanceId = useInstanceId(); const { trackEvent } = useContext(AnalyticsContext); const { inPersonCtaVariantActive } = useContext(InPersonContext); + const [, setStepName] = useHistoryParam(undefined); return (
+ onClick={() => { + setStepName('location'); trackEvent('IdV: verify in person troubleshooting option clicked', { in_person_cta_variant: inPersonCtaVariantActive, - }) - } + }); + }} > {altButtonText || t('in_person_proofing.body.cta.button')} diff --git a/app/javascript/packages/document-capture/components/in-person-location-post-office-search-step.tsx b/app/javascript/packages/document-capture/components/in-person-location-post-office-search-step.tsx index 95e73ff07e8..f5e8fce3792 100644 --- a/app/javascript/packages/document-capture/components/in-person-location-post-office-search-step.tsx +++ b/app/javascript/packages/document-capture/components/in-person-location-post-office-search-step.tsx @@ -112,7 +112,7 @@ function InPersonLocationPostOfficeSearchStep({ onChange, toPreviousStep, regist address={foundAddress?.address || ''} /> )} - + ); } diff --git a/app/javascript/packages/document-capture/components/in-person-prepare-step.spec.tsx b/app/javascript/packages/document-capture/components/in-person-prepare-step.spec.tsx index 74d2cf50ef8..74c1241355d 100644 --- a/app/javascript/packages/document-capture/components/in-person-prepare-step.spec.tsx +++ b/app/javascript/packages/document-capture/components/in-person-prepare-step.spec.tsx @@ -39,7 +39,7 @@ describe('InPersonPrepareStep', () => { { wrapper }, ); - await userEvent.click(getByRole('link', { name: 'forms.buttons.continue' })); + await userEvent.click(getByRole('button', { name: 'forms.buttons.continue' })); await waitFor(() => window.location.hash === inPersonURL); expect(trackEvent).to.have.been.calledWith('IdV: prepare submitted'); @@ -60,10 +60,10 @@ describe('InPersonPrepareStep', () => { { wrapper }, ); - const link = getByRole('link', { name: 'forms.buttons.continue' }); + const button = getByRole('button', { name: 'forms.buttons.continue' }); - const didFollowLinkOnFirstClick = fireEvent.click(link); - const didFollowLinkOnSecondClick = fireEvent.click(link); + const didFollowLinkOnFirstClick = fireEvent.click(button); + const didFollowLinkOnSecondClick = fireEvent.click(button); clock.tick(delay); diff --git a/app/javascript/packages/document-capture/components/in-person-prepare-step.tsx b/app/javascript/packages/document-capture/components/in-person-prepare-step.tsx index 91f5bbcf829..db61517b3b7 100644 --- a/app/javascript/packages/document-capture/components/in-person-prepare-step.tsx +++ b/app/javascript/packages/document-capture/components/in-person-prepare-step.tsx @@ -29,7 +29,7 @@ function InPersonPrepareStep({ toPreviousStep, value }) { setIsSubmitting(true); removeUnloadProtection(); await trackEvent('IdV: prepare submitted'); - window.location.href = (event.target as HTMLAnchorElement).href; + window.location.href = inPersonURL!; } }; @@ -59,7 +59,7 @@ function InPersonPrepareStep({ toPreviousStep, value }) { {flowPath === 'hybrid' && } {inPersonURL && flowPath === 'standard' && (
- + {t('forms.buttons.continue')}
@@ -78,7 +78,7 @@ function InPersonPrepareStep({ toPreviousStep, value }) { )}

- + ); } diff --git a/spec/features/idv/in_person_spec.rb b/spec/features/idv/in_person_spec.rb index 89eaa1c58d9..b0e64653de7 100644 --- a/spec/features/idv/in_person_spec.rb +++ b/spec/features/idv/in_person_spec.rb @@ -342,7 +342,7 @@ mock_doc_auth_attention_with_barcode attach_and_submit_images - click_link t('in_person_proofing.body.cta.button') + click_button t('in_person_proofing.body.cta.button') search_for_post_office within page.first('.location-collection-item') do click_spinner_button_and_wait t('in_person_proofing.body.location.location_button') diff --git a/spec/support/features/in_person_helper.rb b/spec/support/features/in_person_helper.rb index fa52c358d19..5711c3c0e63 100644 --- a/spec/support/features/in_person_helper.rb +++ b/spec/support/features/in_person_helper.rb @@ -73,7 +73,7 @@ def begin_in_person_proofing(_user = nil) complete_doc_auth_steps_before_document_capture_step mock_doc_auth_attention_with_barcode attach_and_submit_images - click_link t('in_person_proofing.body.cta.button') + click_button t('in_person_proofing.body.cta.button') end def search_for_post_office