Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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(<DocumentCaptureTroubleshootingOptions />, {
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(
<DocumentCaptureTroubleshootingOptions location="custom" />,
{
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(
Expand Down Expand Up @@ -174,20 +118,6 @@ describe('DocumentCaptureTroubleshootingOptions', () => {
});
});

context('with sp option turned off', () => {
it('does not display the SP troubleshooting option', () => {
const { queryByRole } = render(
<DocumentCaptureTroubleshootingOptions showSPOption={false} />,
);

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(
Expand All @@ -196,23 +126,5 @@ describe('DocumentCaptureTroubleshootingOptions', () => {

expect(container.innerHTML).to.be.empty();
});

context('with associated service provider', () => {
it('renders troubleshooting options', () => {
const { getAllByRole } = render(
<DocumentCaptureTroubleshootingOptions showDocumentTips={false} />,
{
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',
);
});
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -27,25 +26,17 @@ 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({
heading,
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 (
<>
Expand All @@ -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[]
}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -23,7 +22,6 @@ function InPersonTroubleshootingOptions({
}: InPersonTroubleshootingOptionsProps) {
const { t } = useI18n();
const { getHelpCenterURL } = useContext(MarketingSiteContext);
const { name: spName, getFailureToProofURL } = useContext(ServiceProviderContext);

return (
<TroubleshootingOptions
Expand All @@ -48,11 +46,6 @@ function InPersonTroubleshootingOptions({
text: t('idv.troubleshooting.options.learn_more_verify_by_phone_in_person'),
isExternal: true,
},
spName && {
url: getFailureToProofURL(location),
Comment thread
aduth marked this conversation as resolved.
text: t('idv.troubleshooting.options.get_help_at_sp', { sp_name: spName }),
isExternal: true,
},
].filter(Boolean) as TroubleshootingOption[]
}
/>
Expand Down
8 changes: 0 additions & 8 deletions app/views/idv/phone_errors/_warning.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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 } %>
8 changes: 0 additions & 8 deletions app/views/idv/session_errors/exception.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Comment thread
aduth marked this conversation as resolved.
Outdated
) do %>
<p>
Expand Down
1 change: 0 additions & 1 deletion config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion config/locales/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion config/locales/fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion config/locales/zh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: 对验证你的电话号码获得更多了解
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
<InPersonContext.Provider value={{ inPersonURL: null }}>
<ServiceProviderContextProvider
value={{
name: 'Example App',
failureToProofURL: 'https://example.com/?step=document_capture',
}}
>
<ReviewIssuesStep {...DEFAULT_PROPS} />
</ServiceProviderContextProvider>
</InPersonContext.Provider>,
);

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(
<InPersonContext.Provider value={{ inPersonURL: 'http://example.com' }}>
<ServiceProviderContextProvider
value={{
name: 'Example App',
failureToProofURL: 'https://example.com/?step=document_capture',
}}
>
<ReviewIssuesStep {...DEFAULT_PROPS} />
</ServiceProviderContextProvider>
</InPersonContext.Provider>,
);

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(
<InPersonContext.Provider value={{ inPersonURL: 'http://example.com' }}>
Expand Down
40 changes: 0 additions & 40 deletions spec/views/idv/phone_errors/_warning.html.erb_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 0 additions & 8 deletions spec/views/idv/phone_errors/jobfail.html.erb_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down
8 changes: 0 additions & 8 deletions spec/views/idv/phone_errors/timeout.html.erb_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down
10 changes: 0 additions & 10 deletions spec/views/idv/phone_errors/warning.html.erb_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Loading