From 71567c580b6f1d49f9e9c0612b749d7d68822763 Mon Sep 17 00:00:00 2001 From: Alex Bradley Date: Wed, 15 May 2024 15:35:03 -0400 Subject: [PATCH 1/8] remove Get help at CTA from doc capture components --- ...t-capture-troubleshooting-options.spec.tsx | 88 ------------------- ...cument-capture-troubleshooting-options.tsx | 15 ---- .../in-person-troubleshooting-options.tsx | 7 -- 3 files changed, 110 deletions(-) diff --git a/app/javascript/packages/document-capture/components/document-capture-troubleshooting-options.spec.tsx b/app/javascript/packages/document-capture/components/document-capture-troubleshooting-options.spec.tsx index 553c48cb7fe..9aedbef5a6a 100644 --- a/app/javascript/packages/document-capture/components/document-capture-troubleshooting-options.spec.tsx +++ b/app/javascript/packages/document-capture/components/document-capture-troubleshooting-options.spec.tsx @@ -55,62 +55,6 @@ describe('DocumentCaptureTroubleshootingOptions', () => { expect(links[1].target).to.equal('_blank'); }); - context('with associated service provider', () => { - it('renders troubleshooting options', () => { - const { getAllByRole } = render(, { - wrapper: wrappers.helpCenterAndServiceProviderContext, - }); - - const links = getAllByRole('link') as HTMLAnchorElement[]; - - expect(links).to.have.lengthOf(3); - expect(links[0].textContent).to.equal( - 'idv.troubleshooting.options.doc_capture_tipslinks.new_tab', - ); - expect(links[0].getAttribute('href')).to.equal( - 'https://example.com/redirect/?category=verify-your-identity&article=how-to-add-images-of-your-state-issued-id&location=document_capture_troubleshooting_options', - ); - expect(links[0].target).to.equal('_blank'); - expect(links[1].textContent).to.equal( - 'idv.troubleshooting.options.supported_documentslinks.new_tab', - ); - expect(links[1].getAttribute('href')).to.equal( - 'https://example.com/redirect/?category=verify-your-identity&article=accepted-state-issued-identification&location=document_capture_troubleshooting_options', - ); - expect(links[1].target).to.equal('_blank'); - expect(links[2].textContent).to.equal( - 'idv.troubleshooting.options.get_help_at_splinks.new_tab', - ); - expect(links[2].href).to.equal( - 'http://example.test/url/to/failure-to-proof?location=document_capture_troubleshooting_options', - ); - expect(links[2].target).to.equal('_blank'); - }); - - context('with location prop', () => { - it('appends location to links', () => { - const { getAllByRole } = render( - , - { - wrapper: wrappers.helpCenterAndServiceProviderContext, - }, - ); - - const links = getAllByRole('link') as HTMLAnchorElement[]; - - expect(links[0].href).to.equal( - 'https://example.com/redirect/?category=verify-your-identity&article=how-to-add-images-of-your-state-issued-id&location=custom', - ); - expect(links[1].href).to.equal( - 'https://example.com/redirect/?category=verify-your-identity&article=accepted-state-issued-identification&location=custom', - ); - expect(links[2].href).to.equal( - 'http://example.test/url/to/failure-to-proof?location=custom', - ); - }); - }); - }); - context('with heading prop', () => { it('shows heading text', () => { const { getByRole } = render( @@ -174,20 +118,6 @@ describe('DocumentCaptureTroubleshootingOptions', () => { }); }); - context('with sp option turned off', () => { - it('does not display the SP troubleshooting option', () => { - const { queryByRole } = render( - , - ); - - expect( - queryByRole('link', { - name: 'idv.troubleshooting.options.get_help_at_sp links.new_tab', - }), - ).to.not.exist(); - }); - }); - context('with document tips hidden', () => { it('renders nothing', () => { const { container } = render( @@ -196,23 +126,5 @@ describe('DocumentCaptureTroubleshootingOptions', () => { expect(container.innerHTML).to.be.empty(); }); - - context('with associated service provider', () => { - it('renders troubleshooting options', () => { - const { getAllByRole } = render( - , - { - wrapper: wrappers.helpCenterAndServiceProviderContext, - }, - ); - - const links = getAllByRole('link') as HTMLAnchorElement[]; - - expect(links).to.have.lengthOf(1); - expect(links[0].getAttribute('href')).to.equal( - 'http://example.test/url/to/failure-to-proof?location=document_capture_troubleshooting_options', - ); - }); - }); }); }); diff --git a/app/javascript/packages/document-capture/components/document-capture-troubleshooting-options.tsx b/app/javascript/packages/document-capture/components/document-capture-troubleshooting-options.tsx index df8b4a329a4..b5bbba9f5aa 100644 --- a/app/javascript/packages/document-capture/components/document-capture-troubleshooting-options.tsx +++ b/app/javascript/packages/document-capture/components/document-capture-troubleshooting-options.tsx @@ -2,7 +2,6 @@ import { useContext } from 'react'; import { TroubleshootingOptions } from '@18f/identity-components'; import { useI18n } from '@18f/identity-react-i18n'; import type { TroubleshootingOption } from '@18f/identity-components/troubleshooting-options'; -import ServiceProviderContext from '../context/service-provider'; import MarketingSiteContext from '../context/marketing-site'; import InPersonCallToAction from './in-person-call-to-action'; import { InPersonContext } from '../context'; @@ -27,12 +26,6 @@ interface DocumentCaptureTroubleshootingOptionsProps { * Whether to display alternative options for verifying. */ showAlternativeProofingOptions?: boolean; - - /** - * Whether or not to display option for getting - * help at SP - */ - showSPOption?: boolean; } function DocumentCaptureTroubleshootingOptions({ @@ -40,12 +33,10 @@ function DocumentCaptureTroubleshootingOptions({ location = 'document_capture_troubleshooting_options', showDocumentTips = true, showAlternativeProofingOptions, - showSPOption = true, }: DocumentCaptureTroubleshootingOptionsProps) { const { t } = useI18n(); const { inPersonURL } = useContext(InPersonContext); const { getHelpCenterURL } = useContext(MarketingSiteContext); - const { name: spName, getFailureToProofURL } = useContext(ServiceProviderContext); return ( <> @@ -72,12 +63,6 @@ function DocumentCaptureTroubleshootingOptions({ text: t('idv.troubleshooting.options.supported_documents'), isExternal: true, }, - spName && - showSPOption && { - url: getFailureToProofURL(location), - text: t('idv.troubleshooting.options.get_help_at_sp', { sp_name: spName }), - isExternal: true, - }, ].filter(Boolean) as TroubleshootingOption[] } /> diff --git a/app/javascript/packages/document-capture/components/in-person-troubleshooting-options.tsx b/app/javascript/packages/document-capture/components/in-person-troubleshooting-options.tsx index d644bc1e880..571e572c413 100644 --- a/app/javascript/packages/document-capture/components/in-person-troubleshooting-options.tsx +++ b/app/javascript/packages/document-capture/components/in-person-troubleshooting-options.tsx @@ -2,7 +2,6 @@ import { useContext } from 'react'; import { TroubleshootingOptions } from '@18f/identity-components'; import { useI18n } from '@18f/identity-react-i18n'; import type { TroubleshootingOption } from '@18f/identity-components/troubleshooting-options'; -import ServiceProviderContext from '../context/service-provider'; import MarketingSiteContext from '../context/marketing-site'; interface InPersonTroubleshootingOptionsProps { @@ -23,7 +22,6 @@ function InPersonTroubleshootingOptions({ }: InPersonTroubleshootingOptionsProps) { const { t } = useI18n(); const { getHelpCenterURL } = useContext(MarketingSiteContext); - const { name: spName, getFailureToProofURL } = useContext(ServiceProviderContext); return ( From 5b9c9f8253510a5fcf59447a42693aa675562556 Mon Sep 17 00:00:00 2001 From: Alex Bradley Date: Wed, 15 May 2024 15:48:46 -0400 Subject: [PATCH 2/8] remove Get Help at SP CTA from phone_errors screens --- app/views/idv/phone_errors/_warning.html.erb | 8 ---- .../components/review-issues-step-spec.jsx | 38 ------------------ .../phone_errors/_warning.html.erb_spec.rb | 40 ------------------- .../idv/phone_errors/jobfail.html.erb_spec.rb | 8 ---- .../idv/phone_errors/timeout.html.erb_spec.rb | 8 ---- .../idv/phone_errors/warning.html.erb_spec.rb | 10 ----- 6 files changed, 112 deletions(-) diff --git a/app/views/idv/phone_errors/_warning.html.erb b/app/views/idv/phone_errors/_warning.html.erb index 2148f16a020..c3c024bdc86 100644 --- a/app/views/idv/phone_errors/_warning.html.erb +++ b/app/views/idv/phone_errors/_warning.html.erb @@ -36,13 +36,5 @@ locals: text: t('idv.troubleshooting.options.verify_by_mail'), url: idv_request_letter_path, }, - decorated_sp_session.sp_name && { - url: return_to_sp_failure_to_proof_path( - step: 'phone', - location: local_assigns.fetch(:name, 'warning'), - ), - text: t('idv.troubleshooting.options.get_help_at_sp', sp_name: decorated_sp_session.sp_name), - new_tab: true, - }, ].select(&:present?), ) { yield } %> diff --git a/spec/javascript/packages/document-capture/components/review-issues-step-spec.jsx b/spec/javascript/packages/document-capture/components/review-issues-step-spec.jsx index c62919ff0a7..c2a959ba8ae 100644 --- a/spec/javascript/packages/document-capture/components/review-issues-step-spec.jsx +++ b/spec/javascript/packages/document-capture/components/review-issues-step-spec.jsx @@ -223,44 +223,6 @@ describe('document-capture/components/review-issues-step', () => { }); }); - it('does not render sp help troubleshooting option for errored review', () => { - const { queryByRole } = render( - - - - - , - ); - - expect( - queryByRole('link', { name: 'idv.troubleshooting.options.get_help_at_sp links.new_tab' }), - ).to.not.exist(); - }); - - it('does render sp help troubleshooting option for errored review if in person url present', () => { - const { getByRole } = render( - - - - - , - ); - - expect( - getByRole('link', { name: 'idv.troubleshooting.options.get_help_at_sp links.new_tab' }).href, - ).to.equal('https://example.com/?step=document_capture&location=post_submission_warning'); - }); - it('renders alternative error messages with in person and doc type is not supported', async () => { const { getByRole, getByText, getByLabelText } = render( diff --git a/spec/views/idv/phone_errors/_warning.html.erb_spec.rb b/spec/views/idv/phone_errors/_warning.html.erb_spec.rb index 70ff3c0b36e..488b0ac187b 100644 --- a/spec/views/idv/phone_errors/_warning.html.erb_spec.rb +++ b/spec/views/idv/phone_errors/_warning.html.erb_spec.rb @@ -45,44 +45,4 @@ end end end - - context 'without an SP' do - it 'renders a list of troubleshooting options' do - expect(rendered).not_to have_link( - t('idv.troubleshooting.options.get_help_at_sp', sp_name: sp_name), - href: return_to_sp_failure_to_proof_path, - ) - end - end - - context 'with an SP' do - let(:sp_name) { 'Example SP' } - - it 'renders a list of troubleshooting options' do - expect(rendered).to have_link( - t('idv.troubleshooting.options.get_help_at_sp', sp_name: sp_name), - href: return_to_sp_failure_to_proof_path(step: 'phone', location: 'warning'), - ) - end - - context 'without a name' do - it 'renders failure to proof url with default location' do - expect(rendered).to have_link( - t('idv.troubleshooting.options.get_help_at_sp', sp_name: sp_name), - href: return_to_sp_failure_to_proof_path(step: 'phone', location: 'warning'), - ) - end - end - - context 'with a name' do - let(:assigns) { { name: 'fail' } } - - it 'renders failure to proof url with name as location' do - expect(rendered).to have_link( - t('idv.troubleshooting.options.get_help_at_sp', sp_name: sp_name), - href: return_to_sp_failure_to_proof_path(step: 'phone', location: 'fail'), - ) - end - end - end end diff --git a/spec/views/idv/phone_errors/jobfail.html.erb_spec.rb b/spec/views/idv/phone_errors/jobfail.html.erb_spec.rb index 4a042c382f7..2fd22a7cea8 100644 --- a/spec/views/idv/phone_errors/jobfail.html.erb_spec.rb +++ b/spec/views/idv/phone_errors/jobfail.html.erb_spec.rb @@ -29,10 +29,6 @@ context 'gpo verification disabled' do it 'renders a list of troubleshooting options' do - expect(rendered).to have_link( - t('idv.troubleshooting.options.get_help_at_sp', sp_name: sp_name), - href: return_to_sp_failure_to_proof_path(step: 'phone', location: 'jobfail'), - ) expect(rendered).not_to have_link( t('idv.troubleshooting.options.verify_by_mail'), href: idv_request_letter_path, @@ -44,10 +40,6 @@ let(:gpo_letter_available) { true } it 'renders a list of troubleshooting options' do - expect(rendered).to have_link( - t('idv.troubleshooting.options.get_help_at_sp', sp_name: sp_name), - href: return_to_sp_failure_to_proof_path(step: 'phone', location: 'jobfail'), - ) expect(rendered).to have_link( t('idv.troubleshooting.options.verify_by_mail'), href: idv_request_letter_path, diff --git a/spec/views/idv/phone_errors/timeout.html.erb_spec.rb b/spec/views/idv/phone_errors/timeout.html.erb_spec.rb index c17eea3c4f3..9a9ba822bc0 100644 --- a/spec/views/idv/phone_errors/timeout.html.erb_spec.rb +++ b/spec/views/idv/phone_errors/timeout.html.erb_spec.rb @@ -29,10 +29,6 @@ context 'gpo verification disabled' do it 'renders a list of troubleshooting options' do - expect(rendered).to have_link( - t('idv.troubleshooting.options.get_help_at_sp', sp_name: sp_name), - href: return_to_sp_failure_to_proof_path(step: 'phone', location: 'timeout'), - ) expect(rendered).not_to have_link( t('idv.troubleshooting.options.verify_by_mail'), href: idv_request_letter_path, @@ -44,10 +40,6 @@ let(:gpo_letter_available) { true } it 'renders a list of troubleshooting options' do - expect(rendered).to have_link( - t('idv.troubleshooting.options.get_help_at_sp', sp_name: sp_name), - href: return_to_sp_failure_to_proof_path(step: 'phone', location: 'timeout'), - ) expect(rendered).to have_link( t('idv.troubleshooting.options.verify_by_mail'), href: idv_request_letter_path, diff --git a/spec/views/idv/phone_errors/warning.html.erb_spec.rb b/spec/views/idv/phone_errors/warning.html.erb_spec.rb index a94c30ef57b..77f1ee948cd 100644 --- a/spec/views/idv/phone_errors/warning.html.erb_spec.rb +++ b/spec/views/idv/phone_errors/warning.html.erb_spec.rb @@ -65,16 +65,6 @@ ) end - context 'no sp' do - let(:sp_name) { nil } - it 'does not prompt user to get help at sp' do - expect(rendered).not_to have_link( - t('idv.troubleshooting.options.get_help_at_sp', sp_name: sp_name), - href: return_to_sp_failure_to_proof_path(step: 'phone', location: 'warning'), - ) - end - end - context 'gpo verification disabled' do it 'does not render link to gpo flow' do expect(rendered).not_to have_link( From ff49c3894517012350ace3d8981ecf7256742914 Mon Sep 17 00:00:00 2001 From: Alex Bradley Date: Wed, 15 May 2024 16:01:50 -0400 Subject: [PATCH 3/8] remove Get Help from SP CTA for session_errors screens --- app/views/idv/session_errors/exception.html.erb | 8 -------- spec/views/idv/session_errors/exception.html.erb_spec.rb | 4 ---- 2 files changed, 12 deletions(-) diff --git a/app/views/idv/session_errors/exception.html.erb b/app/views/idv/session_errors/exception.html.erb index cf8338fc047..48df94e5099 100644 --- a/app/views/idv/session_errors/exception.html.erb +++ b/app/views/idv/session_errors/exception.html.erb @@ -12,14 +12,6 @@ text: t('idv.troubleshooting.options.contact_support', app_name: APP_NAME), new_tab: true, }, - decorated_sp_session.sp_name && { - url: return_to_sp_failure_to_proof_path( - step: 'verify_info', - location: request.params[:action], - ), - text: t('idv.troubleshooting.options.get_help_at_sp', sp_name: decorated_sp_session.sp_name), - new_tab: true, - }, ].compact, ) do %>

diff --git a/spec/views/idv/session_errors/exception.html.erb_spec.rb b/spec/views/idv/session_errors/exception.html.erb_spec.rb index a10bd49ed4c..12165400e7b 100644 --- a/spec/views/idv/session_errors/exception.html.erb_spec.rb +++ b/spec/views/idv/session_errors/exception.html.erb_spec.rb @@ -34,10 +34,6 @@ let(:sp_issuer) { 'example-issuer' } it 'renders a list of troubleshooting options' do - expect(rendered).to have_link( - t('idv.troubleshooting.options.get_help_at_sp', sp_name: sp_name), - href: return_to_sp_failure_to_proof_path(step: 'verify_info', location: 'exception'), - ) expect(rendered).to have_link( t('idv.troubleshooting.options.contact_support', app_name: APP_NAME), href: MarketingSite.contact_url, From 588e191972140a1925e674166e5c99b98f77c48c Mon Sep 17 00:00:00 2001 From: Alex Bradley Date: Wed, 15 May 2024 16:03:03 -0400 Subject: [PATCH 4/8] remove get_help_at_sp translation key --- config/locales/en.yml | 1 - config/locales/es.yml | 1 - config/locales/fr.yml | 1 - config/locales/zh.yml | 1 - 4 files changed, 4 deletions(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index f2b9c8bf08a..5625fb4514a 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1116,7 +1116,6 @@ idv.titles.unavailable: We are working to resolve an error idv.troubleshooting.headings.need_assistance: 'Need immediate assistance? Here’s how to get help:' idv.troubleshooting.options.contact_support: Contact %{app_name} Support idv.troubleshooting.options.doc_capture_tips: Tips for taking clear photos of your ID -idv.troubleshooting.options.get_help_at_sp: Get help at %{sp_name} idv.troubleshooting.options.learn_more_verify_by_mail: Learn more about verifying your address by mail idv.troubleshooting.options.learn_more_verify_by_phone: Learn more about what phone number to use idv.troubleshooting.options.learn_more_verify_by_phone_in_person: Learn more about verifying your phone number diff --git a/config/locales/es.yml b/config/locales/es.yml index be900abc9bd..59c59d68949 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -1115,7 +1115,6 @@ idv.titles.unavailable: Estamos trabajando para corregir un error idv.troubleshooting.headings.need_assistance: '¿Necesita ayuda inmediata? Así es como puede obtener ayuda:' idv.troubleshooting.options.contact_support: Contacte con el servicio de asistencia de %{app_name} idv.troubleshooting.options.doc_capture_tips: Consejos para tomar fotos nítidas de su identificación -idv.troubleshooting.options.get_help_at_sp: Obtenga ayuda en %{sp_name} idv.troubleshooting.options.learn_more_verify_by_mail: Obtenga más información sobre la verificación de su dirección por correo idv.troubleshooting.options.learn_more_verify_by_phone: Obtenga más información sobre el número de teléfono que debe usar idv.troubleshooting.options.learn_more_verify_by_phone_in_person: Obtenga más información sobre la verificación de su número de teléfono diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 4a83fdc5950..92ca8fc1919 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -1116,7 +1116,6 @@ idv.titles.unavailable: Nous travaillons à la résolution d’une erreur idv.troubleshooting.headings.need_assistance: 'Vous avez besoin d’une assistance immédiate ? Voici comment obtenir de l’aide :' idv.troubleshooting.options.contact_support: Contacter le service d’assistance de %{app_name} idv.troubleshooting.options.doc_capture_tips: Conseils pour prendre des photos nettes de votre pièce d’identité -idv.troubleshooting.options.get_help_at_sp: Obtenir de l’aide sur %{sp_name} idv.troubleshooting.options.learn_more_verify_by_mail: En savoir plus sur la vérification de votre adresse par courrier idv.troubleshooting.options.learn_more_verify_by_phone: En savoir plus sur quel numéro de téléphone utiliser idv.troubleshooting.options.learn_more_verify_by_phone_in_person: En savoir plus sur la vérification de votre numéro de téléphone diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 8bb4bec1ec1..177f4b9c76c 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -1120,7 +1120,6 @@ idv.titles.unavailable: 我们正在争取解决错误。 idv.troubleshooting.headings.need_assistance: 需要立即帮助?以下是如何得到帮助的步骤: idv.troubleshooting.options.contact_support: 联系 %{app_name} 支持 idv.troubleshooting.options.doc_capture_tips: 拍出你身份证件清晰照片的提示。 -idv.troubleshooting.options.get_help_at_sp: 在 %{sp_name}得到帮助 idv.troubleshooting.options.learn_more_verify_by_mail: 对通过邮件验证你地址获得更多了解 idv.troubleshooting.options.learn_more_verify_by_phone: 了解有关使用什么号码的更多信息 idv.troubleshooting.options.learn_more_verify_by_phone_in_person: 对验证你的电话号码获得更多了解 From 48ea7afa07f23c070679ccdad37b2e8420fae36f Mon Sep 17 00:00:00 2001 From: Alex Bradley Date: Thu, 16 May 2024 10:57:48 -0400 Subject: [PATCH 5/8] add changelog changelog: User-Facing Improvements, IdV, Remove Get Help CTA from non fraud screens From 87c0810fd1e4d7edca1774145aa7f4e44c7c087c Mon Sep 17 00:00:00 2001 From: Alex Bradley Date: Thu, 16 May 2024 13:57:47 -0400 Subject: [PATCH 6/8] remove compact from session_errors/exception --- app/views/idv/session_errors/exception.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/idv/session_errors/exception.html.erb b/app/views/idv/session_errors/exception.html.erb index 48df94e5099..381b181954c 100644 --- a/app/views/idv/session_errors/exception.html.erb +++ b/app/views/idv/session_errors/exception.html.erb @@ -12,7 +12,7 @@ text: t('idv.troubleshooting.options.contact_support', app_name: APP_NAME), new_tab: true, }, - ].compact, + ], ) do %>

<%= t( From 32472344d45f58565f0e93103b23ddf250cc103c Mon Sep 17 00:00:00 2001 From: Alex Bradley Date: Thu, 16 May 2024 15:16:42 -0400 Subject: [PATCH 7/8] remove getFailureToProofUrl --- ...t-capture-troubleshooting-options.spec.tsx | 1 - .../hybrid-doc-capture-warning.spec.tsx | 20 +++++------------- .../context/service-provider.tsx | 9 -------- .../context/service-provider-spec.jsx | 21 ++----------------- 4 files changed, 7 insertions(+), 44 deletions(-) diff --git a/app/javascript/packages/document-capture/components/document-capture-troubleshooting-options.spec.tsx b/app/javascript/packages/document-capture/components/document-capture-troubleshooting-options.spec.tsx index 9aedbef5a6a..8baea2980f6 100644 --- a/app/javascript/packages/document-capture/components/document-capture-troubleshooting-options.spec.tsx +++ b/app/javascript/packages/document-capture/components/document-capture-troubleshooting-options.spec.tsx @@ -14,7 +14,6 @@ describe('DocumentCaptureTroubleshootingOptions', () => { const serviceProviderContext: ServiceProviderContextType = { name: 'Example SP', failureToProofURL: 'http://example.test/url/to/failure-to-proof', - getFailureToProofURL: () => '', }; const wrappers: Record = { MarketingSiteContext: ({ children }: { children?: ReactNode }) => ( diff --git a/app/javascript/packages/document-capture/components/hybrid-doc-capture-warning.spec.tsx b/app/javascript/packages/document-capture/components/hybrid-doc-capture-warning.spec.tsx index 77c0691ecc9..6f2c2ac76ce 100644 --- a/app/javascript/packages/document-capture/components/hybrid-doc-capture-warning.spec.tsx +++ b/app/javascript/packages/document-capture/components/hybrid-doc-capture-warning.spec.tsx @@ -19,9 +19,7 @@ describe('HybridDocCaptureWarning', () => { describe('basic rendering', () => { it('renders a warning alert', () => { const { getByRole } = render( - '' }} - > + , ); @@ -34,9 +32,7 @@ describe('HybridDocCaptureWarning', () => { describe('without SP', () => { it('renders correct warning title', () => { const { getByRole } = render( - '' }} - > + , ); @@ -49,9 +45,7 @@ describe('HybridDocCaptureWarning', () => { it('does not render a third list item pertaining to SP services', () => { const { getByRole } = render( - '' }} - > + , ); @@ -67,9 +61,7 @@ describe('HybridDocCaptureWarning', () => { describe('with SP', () => { it('renders the correct warning title', () => { const { getByRole } = render( - '' }} - > + , ); @@ -83,9 +75,7 @@ describe('HybridDocCaptureWarning', () => { }); it('renders a third list item pertaining to SP services', () => { const { getByRole } = render( - '' }} - > + , ); diff --git a/app/javascript/packages/document-capture/context/service-provider.tsx b/app/javascript/packages/document-capture/context/service-provider.tsx index 8c74c75ff2e..d5a78b57b6c 100644 --- a/app/javascript/packages/document-capture/context/service-provider.tsx +++ b/app/javascript/packages/document-capture/context/service-provider.tsx @@ -1,5 +1,4 @@ import { createContext, useMemo } from 'react'; -import { addSearchParams } from '@18f/identity-url'; import type { ReactNode } from 'react'; export interface ServiceProviderContextType { @@ -11,17 +10,11 @@ export interface ServiceProviderContextType { * URL to redirect user on failure to proof. */ failureToProofURL: string; - /** - * Returns failure to proof URL for a - * specific location within the step. - */ - getFailureToProofURL: (location: string) => string; } const ServiceProviderContext = createContext({ name: null, failureToProofURL: '', - getFailureToProofURL: () => '', }); ServiceProviderContext.displayName = 'ServiceProviderContext'; @@ -35,8 +28,6 @@ function ServiceProviderContextProvider({ value, children }: ServiceProviderCont const mergedValue = useMemo( () => ({ ...value, - getFailureToProofURL: (location: string) => - addSearchParams(value.failureToProofURL, { location }), }), [value], ); diff --git a/spec/javascript/packages/document-capture/context/service-provider-spec.jsx b/spec/javascript/packages/document-capture/context/service-provider-spec.jsx index 1c22ab6bf56..e01714c02aa 100644 --- a/spec/javascript/packages/document-capture/context/service-provider-spec.jsx +++ b/spec/javascript/packages/document-capture/context/service-provider-spec.jsx @@ -1,30 +1,13 @@ import { useContext } from 'react'; import { renderHook } from '@testing-library/react-hooks'; -import ServiceProviderContext, { - Provider, -} from '@18f/identity-document-capture/context/service-provider'; +import ServiceProviderContext from '@18f/identity-document-capture/context/service-provider'; describe('document-capture/context/service-provider', () => { it('has expected default properties', () => { const { result } = renderHook(() => useContext(ServiceProviderContext)); - expect(result.current).to.have.keys(['name', 'failureToProofURL', 'getFailureToProofURL']); + expect(result.current).to.have.keys(['name', 'failureToProofURL']); expect(result.current.name).to.be.null(); expect(result.current.failureToProofURL).to.be.a('string'); - expect(result.current.getFailureToProofURL).to.be.a('function'); - }); - - describe('Provider', () => { - it('customizes getFailureToProofURL to parameterize failureToProofURL location', () => { - const { result } = renderHook(() => useContext(ServiceProviderContext), { - wrapper: ({ children }) => ( - {children} - ), - }); - - const failureToProofURL = result.current.getFailureToProofURL('location name'); - - expect(failureToProofURL).to.equal('http://example.com/?a=1&location=location+name'); - }); }); }); From b213952670ece98991fe2e0faff32bd466e395b8 Mon Sep 17 00:00:00 2001 From: Alex Bradley Date: Fri, 17 May 2024 09:43:27 -0400 Subject: [PATCH 8/8] remove unused prop --- .../document-capture/components/document-capture-warning.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/app/javascript/packages/document-capture/components/document-capture-warning.tsx b/app/javascript/packages/document-capture/components/document-capture-warning.tsx index acb1acbdb02..93fb74a7232 100644 --- a/app/javascript/packages/document-capture/components/document-capture-warning.tsx +++ b/app/javascript/packages/document-capture/components/document-capture-warning.tsx @@ -134,7 +134,6 @@ function DocumentCaptureWarning({ }