From fbce6d08ebb11eaa2def2eb0ad992754f7f8caf3 Mon Sep 17 00:00:00 2001 From: JackRyan1989 Date: Fri, 28 Apr 2023 16:55:55 -0400 Subject: [PATCH 01/14] content updates, minor refactors and tests --- .../components/document-capture.tsx | 10 +-- .../components/in-person-call-to-action.tsx | 2 +- ...erson-location-post-office-search-step.tsx | 24 ++++--- .../components/in-person-prepare-step.tsx | 29 +++++---- .../in-person-troubleshooting-options.tsx | 9 +++ .../components/review-issues-step.tsx | 2 +- .../document-capture/context/analytics.tsx | 4 +- .../packages/form-steps/form-steps.tsx | 3 +- config/locales/idv/en.yml | 1 + config/locales/idv/es.yml | 1 + config/locales/idv/fr.yml | 1 + config/locales/in_person_proofing/en.yml | 6 +- config/locales/in_person_proofing/es.yml | 2 +- config/locales/in_person_proofing/fr.yml | 7 +-- spec/features/idv/in_person_spec.rb | 63 +++++++------------ spec/support/features/in_person_helper.rb | 10 ++- 16 files changed, 87 insertions(+), 87 deletions(-) diff --git a/app/javascript/packages/document-capture/components/document-capture.tsx b/app/javascript/packages/document-capture/components/document-capture.tsx index 5dd591c2de5..5ac4e3d6ba7 100644 --- a/app/javascript/packages/document-capture/components/document-capture.tsx +++ b/app/javascript/packages/document-capture/components/document-capture.tsx @@ -111,16 +111,16 @@ function DocumentCapture({ isAsyncForm = false, onStepChange = () => {} }: Docum inPersonURL === undefined ? [] : ([ - { - name: 'location', - form: InPersonLocationPostOfficeSearchStep, - title: t('in_person_proofing.headings.po_search.location'), - }, { name: 'prepare', form: InPersonPrepareStep, title: t('in_person_proofing.headings.prepare'), }, + { + name: 'location', + form: InPersonLocationPostOfficeSearchStep, + title: t('in_person_proofing.headings.po_search.location'), + }, flowPath === 'hybrid' && { name: 'switch_back', form: InPersonSwitchBackStep, 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 61625ca68fc..1d7489039f7 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 @@ -34,7 +34,7 @@ function InPersonCallToAction({ altHeading, altPrompt, altButtonText }: InPerson isWide className="margin-top-3 margin-bottom-1" onClick={() => { - setStepName('location'); + setStepName('prepare'); trackEvent('IdV: verify in person troubleshooting option clicked', { in_person_cta_variant: inPersonCtaVariantActive, }); 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 f5e8fce3792..5a61705c555 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 @@ -2,6 +2,7 @@ import { useState, useEffect, useCallback, useRef, useContext } from 'react'; import { useI18n } from '@18f/identity-react-i18n'; import { Alert, PageHeading } from '@18f/identity-components'; import { request } from '@18f/identity-request'; +import { forceRedirect } from '@18f/identity-url'; import BackButton from './back-button'; import AnalyticsContext from '../context/analytics'; import AddressSearch, { @@ -12,20 +13,22 @@ import AddressSearch, { } from './address-search'; import InPersonLocations, { FormattedLocation } from './in-person-locations'; import { InPersonContext } from '../context'; +import UploadContext from '../context/upload'; function InPersonLocationPostOfficeSearchStep({ onChange, toPreviousStep, registerField }) { - const { inPersonCtaVariantActive } = useContext(InPersonContext); + const { inPersonCtaVariantActive, inPersonURL } = useContext(InPersonContext); const { t } = useI18n(); const [inProgress, setInProgress] = useState(false); const [isLoadingLocations, setLoadingLocations] = useState(false); const [autoSubmit, setAutoSubmit] = useState(false); - const { setSubmitEventMetadata } = useContext(AnalyticsContext); + const { trackEvent } = useContext(AnalyticsContext); const [locationResults, setLocationResults] = useState( null, ); const [foundAddress, setFoundAddress] = useState(null); const [apiError, setApiError] = useState(null); const [disabledAddressSearch, setDisabledAddressSearch] = useState(false); + const { flowPath } = useContext(UploadContext); // ref allows us to avoid a memory leak const mountedRef = useRef(false); @@ -40,13 +43,10 @@ function InPersonLocationPostOfficeSearchStep({ onChange, toPreviousStep, regist // useCallBack here prevents unnecessary rerenders due to changing function identity const handleLocationSelect = useCallback( async (e: any, id: number) => { + flowPath !== 'hybrid' ? e.preventDefault() : null; const selectedLocation = locationResults![id]!; const { streetAddress, formattedCityStateZip } = selectedLocation; const selectedLocationAddress = `${streetAddress}, ${formattedCityStateZip}`; - setSubmitEventMetadata({ - selected_location: selectedLocationAddress, - in_person_cta_variant: inPersonCtaVariantActive, - }); onChange({ selectedLocationAddress }); if (autoSubmit) { setDisabledAddressSearch(true); @@ -57,8 +57,6 @@ function InPersonLocationPostOfficeSearchStep({ onChange, toPreviousStep, regist }, 250); return; } - // prevent navigation from continuing - e.preventDefault(); if (inProgress) { return; } @@ -69,16 +67,22 @@ function InPersonLocationPostOfficeSearchStep({ onChange, toPreviousStep, regist json: selected, method: 'PUT', }); + // In try block set success of request. If the request is successful, fire remaining code? if (mountedRef.current) { setAutoSubmit(true); setImmediate(() => { - // continue with navigation e.target.disabled = false; - e.target.click(); + trackEvent('IdV: location submitted', { + selected_location: selectedLocationAddress, + in_person_cta_variant: inPersonCtaVariantActive, + }); + forceRedirect(inPersonURL!); // allow process to be re-triggered in case submission did not work as expected setAutoSubmit(false); }); } + } catch { + setAutoSubmit(false); } finally { if (mountedRef.current) { setInProgress(false); 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 db61517b3b7..956fff0f511 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 @@ -1,11 +1,12 @@ import { useContext, useState } from 'react'; import type { MouseEventHandler } from 'react'; -import { Alert, Link, PageHeading, ProcessList, ProcessListItem } from '@18f/identity-components'; +import { Link, PageHeading, ProcessList, ProcessListItem } from '@18f/identity-components'; import { removeUnloadProtection } from '@18f/identity-url'; import { getConfigValue } from '@18f/identity-config'; import { useI18n } from '@18f/identity-react-i18n'; import { FormStepsButton } from '@18f/identity-form-steps'; import { SpinnerButton } from '@18f/identity-spinner-button'; +import useHistoryParam from '@18f/identity-form-steps/use-history-param'; import UploadContext from '../context/upload'; import MarketingSiteContext from '../context/marketing-site'; import AnalyticsContext from '../context/analytics'; @@ -13,40 +14,38 @@ import BackButton from './back-button'; import InPersonTroubleshootingOptions from './in-person-troubleshooting-options'; import { InPersonContext } from '../context'; -function InPersonPrepareStep({ toPreviousStep, value }) { +function InPersonPrepareStep({ toPreviousStep }) { const { t } = useI18n(); const [isSubmitting, setIsSubmitting] = useState(false); - const { inPersonURL } = useContext(InPersonContext); const { flowPath } = useContext(UploadContext); - const { trackEvent } = useContext(AnalyticsContext); + const { trackEvent, setSubmitEventMetadata } = useContext(AnalyticsContext); const { securityAndPrivacyHowItWorksURL } = useContext(MarketingSiteContext); - const { selectedLocationAddress } = value; + const [, setStepName] = useHistoryParam(undefined); + const { inPersonURL, inPersonCtaVariantActive } = useContext(InPersonContext); - const onContinue: MouseEventHandler = async (event) => { + const onContinue: MouseEventHandler = (event) => { event.preventDefault(); if (!isSubmitting) { setIsSubmitting(true); removeUnloadProtection(); - await trackEvent('IdV: prepare submitted'); - window.location.href = inPersonURL!; + setSubmitEventMetadata({ in_person_cta_variant: inPersonCtaVariantActive }); + trackEvent('IdV: prepare submitted'); + setStepName('location'); } }; return ( <> - {selectedLocationAddress && ( - - {t('in_person_proofing.body.prepare.alert_selected_post_office', { - full_address: selectedLocationAddress, - })} - - )} {t('in_person_proofing.headings.prepare')}

{t('in_person_proofing.body.prepare.verify_step_about')}

+ & const DEFAULT_EVENT_METADATA: Record = {}; -export const LOGGED_STEPS: string[] = ['location', 'prepare', 'switch_back']; +export const LOGGED_STEPS: string[] = ['prepare', 'location', 'switch_back']; const AnalyticsContext = createContext({ trackEvent: () => Promise.resolve(), @@ -71,7 +71,7 @@ export function AnalyticsContextProvider({ children, trackEvent }: AnalyticsCont const extraAnalyticsAttributes = (stepName) => { const extra: EventMetadata = { ...DEFAULT_EVENT_METADATA }; - if (stepName === 'location') { + if (stepName === 'prepare' || stepName === 'location') { extra.in_person_cta_variant = inPersonCtaVariantActive; } return extra; diff --git a/app/javascript/packages/form-steps/form-steps.tsx b/app/javascript/packages/form-steps/form-steps.tsx index c1ac8ac689f..05b728d5c12 100644 --- a/app/javascript/packages/form-steps/form-steps.tsx +++ b/app/javascript/packages/form-steps/form-steps.tsx @@ -396,14 +396,13 @@ function FormSteps({ } onStepSubmit(step?.name); - const nextStepIndex = stepIndex + 1; const isComplete = stepCanComplete !== undefined ? stepCanComplete : nextStepIndex === steps.length; if (isComplete) { onComplete(values); } else { - const { name: nextStepName } = steps[nextStepIndex]; + const { name: nextStepName } = steps[nextStepIndex] ?? steps[steps.length - 1]; setStepName(nextStepName); } // unset stepCanComplete so the next step that needs to can set it diff --git a/config/locales/idv/en.yml b/config/locales/idv/en.yml index 133f105d89b..710d2d076c6 100644 --- a/config/locales/idv/en.yml +++ b/config/locales/idv/en.yml @@ -234,6 +234,7 @@ en: learn_more_address_verification_options: Learn more about verifying by phone or mail learn_more_verify_by_mail: Learn more about verifying your address by mail learn_more_verify_by_phone: Learn more about what phone number to use + learn_more_verify_by_phone_in_person: Learn more about verifying your phone number learn_more_verify_in_person: Learn more about verifying in person supported_documents: See a list of accepted state-issued IDs verify_by_mail: Verify your address by mail instead diff --git a/config/locales/idv/es.yml b/config/locales/idv/es.yml index 99c8aef6118..7316aa17ee7 100644 --- a/config/locales/idv/es.yml +++ b/config/locales/idv/es.yml @@ -248,6 +248,7 @@ es: learn_more_verify_by_mail: Obtenga más información sobre la verificación de su dirección por correo learn_more_verify_by_phone: Más información sobre qué número de teléfono usar + learn_more_verify_by_phone_in_person: Más información sobre cómo verificar su número de teléfono learn_more_verify_in_person: Más información sobre la verificación en persona supported_documents: Vea la lista de documentos de identidad emitidos por el estado que son aceptados diff --git a/config/locales/idv/fr.yml b/config/locales/idv/fr.yml index c341b22f202..07a5e6ec935 100644 --- a/config/locales/idv/fr.yml +++ b/config/locales/idv/fr.yml @@ -262,6 +262,7 @@ fr: learn_more_address_verification_options: En savoir plus sur la vérification par téléphone ou par courrier learn_more_verify_by_mail: En savoir plus sur la vérification de votre adresse par courrier learn_more_verify_by_phone: Apprenez-en plus sur quel numéro de téléphone utiliser + learn_more_verify_by_phone_in_person: En savoir plus sur la vérification de votre numéro de téléphone learn_more_verify_in_person: En savoir plus sur la vérification en personne supported_documents: Voir la liste des pièces d’identité acceptées et délivrées par l’État verify_by_mail: Vérifiez plutôt votre adresse par courrier diff --git a/config/locales/in_person_proofing/en.yml b/config/locales/in_person_proofing/en.yml index 2508606b0c8..c036a7b43c7 100644 --- a/config/locales/in_person_proofing/en.yml +++ b/config/locales/in_person_proofing/en.yml @@ -45,8 +45,8 @@ en: %{address}. none_found_tip: You can search using a different address, or add photos of your ID to try and verify your identity online again. - po_search_about: If you are having trouble adding your ID, you may be able to - verify your identity in person at a local United States Post Office. + po_search_about: You can verify your identity in person at a local participating + United States Post Office. results_description: one: There is one participating Post Office within 50 miles of %{address}. other: There are %{count} participating Post Offices within 50 miles of @@ -59,7 +59,6 @@ en: retail_hours_sun: 'Sun:' retail_hours_weekday: 'Monday to Friday:' prepare: - alert_selected_post_office: You’ve selected the Post Office at %{full_address}. privacy_disclaimer: '%{app_name} is a secure, government website. We and the U.S. Postal Service use your data to verify your identity.' privacy_disclaimer_link: Learn more about privacy and security. @@ -69,6 +68,7 @@ en: verify_step_enter_phone: Enter your primary phone number or the number that you use most often. verify_step_enter_pii: Enter your name, date of birth, state-issued ID number, address and Social Security number. + verify_step_post_office: Find a participating Post Office near you. state_id: alert_message: 'Your state-issued ID must not be expired. Accepted forms of ID are:' id_types: diff --git a/config/locales/in_person_proofing/es.yml b/config/locales/in_person_proofing/es.yml index 57b8ad7bc48..f41d2ccc8bf 100644 --- a/config/locales/in_person_proofing/es.yml +++ b/config/locales/in_person_proofing/es.yml @@ -67,7 +67,6 @@ es: retail_hours_sun: 'Dom:' retail_hours_weekday: 'De Lunes a Viernes:' prepare: - alert_selected_post_office: Ha seleccionado la oficina de correos a %{full_address}. privacy_disclaimer: '%{app_name} es un sitio web seguro del gobierno. Nosotros y el Servicio Postal de los Estados Unidos utilizamos sus datos para verificar su identidad.' @@ -80,6 +79,7 @@ es: verify_step_enter_pii: Ingrese su nombre, fecha de nacimiento, número de identificación emitido por el estado, dirección y número de la Seguridad Social. + verify_step_post_office: Encuentre una Oficina de Correos participantes cercana a usted. state_id: alert_message: 'Su identificación emitida por el estado no debe estar vencida. Se aceptan las siguientes formas de identificación:' diff --git a/config/locales/in_person_proofing/fr.yml b/config/locales/in_person_proofing/fr.yml index 9755b810d5b..39e330b6dd8 100644 --- a/config/locales/in_person_proofing/fr.yml +++ b/config/locales/in_person_proofing/fr.yml @@ -51,9 +51,8 @@ fr: none_found_tip: Vous pouvez effectuer une recherche en utilisant une autre adresse, ou ajouter des photos de votre pièce d’identité pour essayer de vérifier à nouveau votre identité en ligne. - po_search_about: Si vous avez des difficultés à ajouter votre pièce d’identité, - vous pouvez vérifier votre identité en personne dans un bureau de - poste américain proche. + po_search_about: Vous pouvez vérifier votre identité en personne dans un bureau + de poste américain local participant. results_description: one: Il y a 1 bureau de poste participant dans un rayon de 50 miles autour de %{address}. @@ -67,7 +66,6 @@ fr: retail_hours_sun: 'Dim:' retail_hours_weekday: 'Lundi à Vendredi:' prepare: - alert_selected_post_office: Vous avez sélectionné le bureau de poste à %{full_address}. privacy_disclaimer: '%{app_name} est un site gouvernemental sécurisé. Nous et le service postal américain utilisons vos données pour vérifier votre identité.' @@ -80,6 +78,7 @@ fr: verify_step_enter_pii: Saisissez votre nom, votre date de naissance, votre document d’identité délivré par l’État, votre adresse et votre numéro de sécurité sociale. + verify_step_post_office: Trouver un bureau de poste participant. state_id: alert_message: 'Votre carte d’identité délivrée par l’État ne doit pas être périmée. Les pièces d’identité acceptées sont:' diff --git a/spec/features/idv/in_person_spec.rb b/spec/features/idv/in_person_spec.rb index 2289a2a6c94..62ebb977b64 100644 --- a/spec/features/idv/in_person_spec.rb +++ b/spec/features/idv/in_person_spec.rb @@ -23,12 +23,12 @@ it 'allows the user to continue down the happy path', allow_browser_log: true do sign_in_and_2fa_user(user) begin_in_person_proofing(user) - # location page - complete_location_step - # prepare page complete_prepare_step(user) + # location page + complete_location_step + # state ID page complete_state_id_step(user) @@ -118,16 +118,16 @@ sign_in_and_2fa_user(user) begin_in_person_proofing(user) - # location page - expect_in_person_step_indicator_current_step(t('step_indicator.flows.idv.find_a_post_office')) - expect(page).to have_content(t('in_person_proofing.headings.po_search.location')) - complete_location_step - # prepare page expect(page).to(have_content(t('in_person_proofing.body.prepare.verify_step_about'))) expect_in_person_step_indicator_current_step(t('step_indicator.flows.idv.find_a_post_office')) complete_prepare_step(user) + # location page + expect_in_person_step_indicator_current_step(t('step_indicator.flows.idv.find_a_post_office')) + expect(page).to have_content(t('in_person_proofing.headings.po_search.location')) + complete_location_step + # state ID page expect_in_person_step_indicator_current_step( t('step_indicator.flows.idv.verify_info'), @@ -249,22 +249,17 @@ complete_all_in_person_proofing_steps end - it 'allows the user to go back to document capture from prepare step', allow_browser_log: true do + it 'allows the user to go back to document capture from location step', allow_browser_log: true do sign_in_and_2fa_user begin_in_person_proofing - - # location page - expect(page).to have_content(t('in_person_proofing.headings.po_search.location')) - complete_location_step - - # prepare page - expect(page).to have_content(t('in_person_proofing.headings.prepare'), wait: 5) - click_button t('forms.buttons.back') - - expect(page).to have_content(t('in_person_proofing.headings.po_search.location')) - + complete_prepare_step search_for_post_office expect(page).to have_css('.location-collection-item', wait: 10) + # back to prepare page + click_button t('forms.buttons.back') + expect(page).to have_content(t('in_person_proofing.headings.prepare')) + + # back to doc capture page click_button t('forms.buttons.back') # Note: This is specifically for failed barcodes. Other cases may use @@ -335,14 +330,12 @@ # error page click_button t('in_person_proofing.body.cta.button') - - # location page - expect(page).to have_content(t('in_person_proofing.headings.po_search.location')) - complete_location_step - # prepare page expect(page).to(have_content(t('in_person_proofing.body.prepare.verify_step_about'))) click_idv_continue + # location page + expect(page).to have_content(t('in_person_proofing.headings.po_search.location')) + complete_location_step # switch back page expect(page).to have_content(t('in_person_proofing.headings.switch_back')) @@ -437,8 +430,8 @@ allow_browser_log: true do sign_in_and_2fa_user begin_in_person_proofing - complete_location_step complete_prepare_step + complete_location_step expect(page).to have_current_path(idv_in_person_step_path(step: :state_id), wait: 10) fill_out_state_id_form_ok(double_address_verification: double_address_verification) @@ -506,8 +499,8 @@ allow_browser_log: true do sign_in_and_2fa_user begin_in_person_proofing - complete_location_step complete_prepare_step + complete_location_step expect(page).to have_current_path(idv_in_person_step_path(step: :state_id), wait: 10) fill_out_state_id_form_ok @@ -585,18 +578,13 @@ sign_in_and_2fa_user(user) begin_in_person_proofing(user) + complete_prepare_step(user) complete_location_step(user) - - expect(page).to have_content( - t('in_person_proofing.headings.prepare'), wait: 5 - ) end it 'does not capture separate state id address from residential address' do allow(IdentityConfig.store).to receive(:in_person_capture_secondary_id_enabled). and_return(true) - # prepare page - complete_prepare_step(user) complete_state_id_step(user) complete_address_step(user) complete_ssn_step(user) @@ -612,15 +600,10 @@ sign_in_and_2fa_user(user) begin_in_person_proofing(user) + complete_prepare_step(user) complete_location_step(user) - - expect(page).to have_content( - t('in_person_proofing.headings.prepare'), wait: 5 - ) end - # prepare page it 'successfully proceeds through the flow' do - complete_prepare_step(user) complete_state_id_step(user, same_address_as_id: false, double_address_verification: true) @@ -658,8 +641,8 @@ sign_in_and_2fa_user(user) begin_in_person_proofing(user) - complete_location_step(user) complete_prepare_step(user) + complete_location_step(user) end it 'skips the address page' do diff --git a/spec/support/features/in_person_helper.rb b/spec/support/features/in_person_helper.rb index d39e41154ab..ad72856f29f 100644 --- a/spec/support/features/in_person_helper.rb +++ b/spec/support/features/in_person_helper.rb @@ -86,6 +86,8 @@ def begin_in_person_proofing(_user = nil) end def search_for_post_office + expect(page).to have_content(t('in_person_proofing.body.location.po_search.po_search_about')) + expect_in_person_step_indicator_current_step(t('step_indicator.flows.idv.find_a_post_office')) fill_in t('in_person_proofing.body.location.po_search.address_search_label'), with: GOOD_ADDRESS1 click_spinner_button_and_wait(t('in_person_proofing.body.location.po_search.search_button')) @@ -108,8 +110,10 @@ def complete_location_step(_user = nil) end def complete_prepare_step(_user = nil) - expect(page).to have_text(t('forms.buttons.continue'), wait: 10) - click_spinner_button_and_wait t('forms.buttons.continue') + expect(page).to(have_content(t('in_person_proofing.headings.prepare'))) + expect(page).to(have_content(t('in_person_proofing.body.prepare.verify_step_about'))) + expect_in_person_step_indicator_current_step(t('step_indicator.flows.idv.find_a_post_office')) + click_on t('forms.buttons.continue') end def complete_state_id_step(_user = nil, same_address_as_id: true, @@ -142,8 +146,8 @@ def complete_verify_step(_user = nil) end def complete_all_in_person_proofing_steps(user = user_with_2fa) - complete_location_step(user) complete_prepare_step(user) + complete_location_step(user) complete_state_id_step(user) complete_address_step(user) complete_ssn_step(user) From 6debd201ebc0a1986cf50ea98449aaecccba861c Mon Sep 17 00:00:00 2001 From: JackRyan1989 Date: Fri, 28 Apr 2023 17:01:56 -0400 Subject: [PATCH 02/14] Whacking with linter --- spec/features/idv/in_person_spec.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/spec/features/idv/in_person_spec.rb b/spec/features/idv/in_person_spec.rb index 62ebb977b64..883451e110c 100644 --- a/spec/features/idv/in_person_spec.rb +++ b/spec/features/idv/in_person_spec.rb @@ -604,7 +604,6 @@ complete_location_step(user) end it 'successfully proceeds through the flow' do - complete_state_id_step(user, same_address_as_id: false, double_address_verification: true) complete_address_step(user, double_address_verification: true) From 7b1d9d858a460eff5ee477ef4214706d7fc856a7 Mon Sep 17 00:00:00 2001 From: JackRyan1989 Date: Fri, 28 Apr 2023 17:02:52 -0400 Subject: [PATCH 03/14] changelog: User-facing improvements, In-person Proofing, Put Prepare step ahead of Location step in IPP flow From 427f765cfca0500eb6245f32f5392c24e2dd6c0a Mon Sep 17 00:00:00 2001 From: JackRyan1989 Date: Fri, 28 Apr 2023 21:56:01 -0400 Subject: [PATCH 04/14] Fix verify info spec presentation order --- spec/features/idv/steps/in_person/verify_info_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/features/idv/steps/in_person/verify_info_spec.rb b/spec/features/idv/steps/in_person/verify_info_spec.rb index f71f2c0538d..4d0c36f8e45 100644 --- a/spec/features/idv/steps/in_person/verify_info_spec.rb +++ b/spec/features/idv/steps/in_person/verify_info_spec.rb @@ -17,8 +17,8 @@ sign_in_and_2fa_user(user) begin_in_person_proofing(user) - complete_location_step(user) complete_prepare_step(user) + complete_location_step(user) complete_state_id_step(user) complete_address_step(user) complete_ssn_step(user) From 599cf3a8c6daf5a5c5bc4b0de1f81eb04a89845e Mon Sep 17 00:00:00 2001 From: JackRyan1989 Date: Mon, 1 May 2023 14:59:06 -0400 Subject: [PATCH 05/14] get rid of dirty ternary --- .../components/in-person-location-post-office-search-step.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 5a61705c555..c53b5713fe1 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 @@ -43,7 +43,9 @@ function InPersonLocationPostOfficeSearchStep({ onChange, toPreviousStep, regist // useCallBack here prevents unnecessary rerenders due to changing function identity const handleLocationSelect = useCallback( async (e: any, id: number) => { - flowPath !== 'hybrid' ? e.preventDefault() : null; + if (flowPath !== 'hybrid') { + e.preventDefault(); + } const selectedLocation = locationResults![id]!; const { streetAddress, formattedCityStateZip } = selectedLocation; const selectedLocationAddress = `${streetAddress}, ${formattedCityStateZip}`; From ae30a8a07a0d64d866a397f192fe5fa3ace3a5ef Mon Sep 17 00:00:00 2001 From: JackRyan1989 Date: Mon, 1 May 2023 17:08:57 -0400 Subject: [PATCH 06/14] Updating specs --- spec/features/idv/steps/in_person/verify_step_spec.rb | 6 +++--- spec/support/features/in_person_helper.rb | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/spec/features/idv/steps/in_person/verify_step_spec.rb b/spec/features/idv/steps/in_person/verify_step_spec.rb index 12b974008ae..0dfc39237d9 100644 --- a/spec/features/idv/steps/in_person/verify_step_spec.rb +++ b/spec/features/idv/steps/in_person/verify_step_spec.rb @@ -27,8 +27,8 @@ sign_in_and_2fa_user(user) begin_in_person_proofing(user) - complete_location_step(user) complete_prepare_step(user) + complete_location_step(user) complete_state_id_step(user, double_address_verification: double_address_verification) complete_address_step(user, double_address_verification: double_address_verification) complete_ssn_step(user) @@ -94,8 +94,8 @@ allow_browser_log: true do sign_in_and_2fa_user(user) begin_in_person_proofing(user) - complete_location_step(user) complete_prepare_step(user) + complete_location_step(user) complete_state_id_step( user, same_address_as_id: same_address_as_id, double_address_verification: double_address_verification @@ -143,8 +143,8 @@ allow_browser_log: true do sign_in_and_2fa_user(user) begin_in_person_proofing(user) - complete_location_step(user) complete_prepare_step(user) + complete_location_step(user) complete_state_id_step( user, same_address_as_id: same_address_as_id, double_address_verification: double_address_verification diff --git a/spec/support/features/in_person_helper.rb b/spec/support/features/in_person_helper.rb index ad72856f29f..074d3ceb08f 100644 --- a/spec/support/features/in_person_helper.rb +++ b/spec/support/features/in_person_helper.rb @@ -86,7 +86,8 @@ def begin_in_person_proofing(_user = nil) end def search_for_post_office - expect(page).to have_content(t('in_person_proofing.body.location.po_search.po_search_about')) + expect(page).to(have_content(t('in_person_proofing.headings.po_search.location'))) + expect(page).to(have_content(t('in_person_proofing.body.location.po_search.po_search_about'))) expect_in_person_step_indicator_current_step(t('step_indicator.flows.idv.find_a_post_office')) fill_in t('in_person_proofing.body.location.po_search.address_search_label'), with: GOOD_ADDRESS1 From 6fa61a3dfa68075db4006b4f02a4d9a937b83886 Mon Sep 17 00:00:00 2001 From: JackRyan1989 Date: Tue, 2 May 2023 11:17:49 -0400 Subject: [PATCH 07/14] remove unnecessary else statement --- app/javascript/packages/form-steps/form-steps.tsx | 3 --- 1 file changed, 3 deletions(-) diff --git a/app/javascript/packages/form-steps/form-steps.tsx b/app/javascript/packages/form-steps/form-steps.tsx index 05b728d5c12..97a0879e4b2 100644 --- a/app/javascript/packages/form-steps/form-steps.tsx +++ b/app/javascript/packages/form-steps/form-steps.tsx @@ -401,9 +401,6 @@ function FormSteps({ stepCanComplete !== undefined ? stepCanComplete : nextStepIndex === steps.length; if (isComplete) { onComplete(values); - } else { - const { name: nextStepName } = steps[nextStepIndex] ?? steps[steps.length - 1]; - setStepName(nextStepName); } // unset stepCanComplete so the next step that needs to can set it setStepCanComplete(undefined); From 607e11408c614d21a6caa6331828663a061a36e7 Mon Sep 17 00:00:00 2001 From: JackRyan1989 Date: Wed, 3 May 2023 12:28:28 -0400 Subject: [PATCH 08/14] use fsm for prepare step --- .../components/in-person-call-to-action.tsx | 2 +- .../components/in-person-prepare-step.spec.tsx | 4 ++-- .../components/in-person-prepare-step.tsx | 9 ++------- app/javascript/packages/form-steps/form-steps.tsx | 3 +++ spec/features/idv/in_person_spec.rb | 2 +- 5 files changed, 9 insertions(+), 11 deletions(-) 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 1d7489039f7..a79c30a671f 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 @@ -29,12 +29,12 @@ function InPersonCallToAction({ altHeading, altPrompt, altButtonText }: InPerson

{altPrompt || t('in_person_proofing.body.cta.prompt_detail')}