diff --git a/app/services/marketing_site.rb b/app/services/marketing_site.rb index ce70067eb7f..67b48f7ff64 100644 --- a/app/services/marketing_site.rb +++ b/app/services/marketing_site.rb @@ -17,6 +17,7 @@ class UnknownArticleException < StandardError; end verify-your-identity/phone-number verify-your-identity/verify-your-address-by-mail verify-your-identity/overview + verify-your-identity/verify-your-identity-in-person/find-a-participating-post-office ].to_set.freeze def self.locale_segment diff --git a/app/views/idv/in_person/ready_to_verify/show.html.erb b/app/views/idv/in_person/ready_to_verify/show.html.erb index 0e03425babd..f268492a311 100644 --- a/app/views/idv/in_person/ready_to_verify/show.html.erb +++ b/app/views/idv/in_person/ready_to_verify/show.html.erb @@ -228,6 +228,23 @@ <% end %> + +<% if !@is_enhanced_ipp %> +

<%= t('in_person_proofing.body.location.change_location_heading') %>

+

+ <%= t( + 'in_person_proofing.body.location.change_location_info_html', + find_other_locations_link_html: link_to( + t('in_person_proofing.body.location.change_location_find_other_locations'), + help_center_redirect_url( + category: 'verify-your-identity', + article: 'verify-your-identity-in-person/find-a-participating-post-office', + ), + ), + ) %> +

+<% end %> +

<%= t('in_person_proofing.body.expect.heading') %>

<%= t('in_person_proofing.body.expect.info') %>

diff --git a/app/views/user_mailer/shared/_in_person_ready_to_verify.html.erb b/app/views/user_mailer/shared/_in_person_ready_to_verify.html.erb index b64af462add..d61de5bf003 100644 --- a/app/views/user_mailer/shared/_in_person_ready_to_verify.html.erb +++ b/app/views/user_mailer/shared/_in_person_ready_to_verify.html.erb @@ -275,5 +275,22 @@ <% end %> +<% if !@is_enhanced_ipp %> +

<%= t('in_person_proofing.body.location.change_location_heading') %>

+

+ <%= t( + 'in_person_proofing.body.location.change_location_info_html', + find_other_locations_link_html: link_to( + t('in_person_proofing.body.location.change_location_find_other_locations'), + help_center_redirect_url( + category: 'verify-your-identity', + article: 'verify-your-identity-in-person/find-a-participating-post-office', + ), + ), + ).html_safe %> +

+<% end %> + +

<%= t('in_person_proofing.body.expect.heading') %>

<%= t('in_person_proofing.body.expect.info') %>

diff --git a/config/locales/en.yml b/config/locales/en.yml index e6c366a31ce..465a693593c 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1211,10 +1211,13 @@ in_person_proofing.body.cta.button: Try in person in_person_proofing.body.cta.prompt_detail: Most people who are unable to complete this step online are successful in verifying their identity at a participating Post Office. No appointment needed. Locations are available nationwide. in_person_proofing.body.expect.heading: What to expect after your visit in_person_proofing.body.expect.info: We’ll send you an email to let you know if your identity verification was successful or unsuccessful within 24 hours of your visit to the Post Office. +in_person_proofing.body.location.change_location_find_other_locations: Find other participating Post Office locations. +in_person_proofing.body.location.change_location_heading: Need to change your Post Office location? +in_person_proofing.body.location.change_location_info_html: You don’t need to create a new barcode, you can bring this barcode to any participating Post Office location. %{find_other_locations_link_html} in_person_proofing.body.location.distance.one: '%{count} mile away' in_person_proofing.body.location.distance.other: '%{count} miles away' in_person_proofing.body.location.heading: Post Office information -in_person_proofing.body.location.info: No appointment is needed to verify your identity. You can visit any participating Post Office location. +in_person_proofing.body.location.info: No appointment is needed to verify your identity. in_person_proofing.body.location.inline_error: Enter a valid address with city, state, and ZIP code in_person_proofing.body.location.location_button: Select in_person_proofing.body.location.po_search.address_label: Address diff --git a/config/locales/es.yml b/config/locales/es.yml index c8dd2efd5f0..899500bb098 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -1222,10 +1222,13 @@ in_person_proofing.body.cta.button: Intentar en persona in_person_proofing.body.cta.prompt_detail: La mayoría de las personas que no pueden hacer la verificación de su identidad en línea logran verificarla en una oficina de correos participante. No es necesario hacer cita para ello, y hay oficinas en todo el país. in_person_proofing.body.expect.heading: Qué esperar después de la visita in_person_proofing.body.expect.info: En las 24 horas siguientes a su visita a la oficina de correos, recibirá un correo electrónico para informarle si se logró o no su verificación de identidad. +in_person_proofing.body.location.change_location_find_other_locations: Busque otras oficinas de correos participantes. +in_person_proofing.body.location.change_location_heading: ¿Necesita cambiar su oficina de correos? +in_person_proofing.body.location.change_location_info_html: No necesita crear un nuevo código de barras, puede llevar este código de barras a cualquier oficina de correos participante. %{find_other_locations_link_html} in_person_proofing.body.location.distance.one: A %{count} milla de distancia in_person_proofing.body.location.distance.other: A %{count} millas de distancia in_person_proofing.body.location.heading: Información de la oficina de correos -in_person_proofing.body.location.info: No necesita hacer una cita para verificar su identidad. Puede acudir a cualquier oficina de correos participante. +in_person_proofing.body.location.info: No necesita hacer una cita para verificar su identidad. in_person_proofing.body.location.inline_error: Ingrese una dirección válida que incluya ciudad, estado y código postal in_person_proofing.body.location.location_button: Seleccionar in_person_proofing.body.location.po_search.address_label: Dirección diff --git a/config/locales/fr.yml b/config/locales/fr.yml index c078e9c4862..1dc89fa0c6f 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -1211,10 +1211,13 @@ in_person_proofing.body.cta.button: Essayer en personne in_person_proofing.body.cta.prompt_detail: La plupart des personnes qui ne parviennent pas à effectuer cette étape en ligne réussissent à confirmer leur identité dans un bureau de poste participant. Sans rendez-vous. Il existe des sites dans l’ensemble du pays. in_person_proofing.body.expect.heading: Que faire après votre visite in_person_proofing.body.expect.info: Nous vous enverrons un e-mail pour vous informer de la réussite ou de l’échec de la vérification de votre identité dans les 24 heures suivant votre visite au bureau de poste. +in_person_proofing.body.location.change_location_find_other_locations: Trouvez d’autres bureaux de poste participants. +in_person_proofing.body.location.change_location_heading: Vous devez changer de bureau de poste ? +in_person_proofing.body.location.change_location_info_html: Pas besoin de créer un nouveau code-barres. Vous pouvez apporter le vôtre à n’importe quel bureau de poste participant. %{find_other_locations_link_html} in_person_proofing.body.location.distance.one: à %{count} mile in_person_proofing.body.location.distance.other: à %{count} miles in_person_proofing.body.location.heading: Informations sur les bureaux de poste -in_person_proofing.body.location.info: Aucun rendez-vous n’est nécessaire pour vérifier votre identité. Vous pouvez vous rendre dans n’importe quel bureau de poste participant. +in_person_proofing.body.location.info: Aucun rendez-vous n’est nécessaire pour vérifier votre identité. in_person_proofing.body.location.inline_error: Saisissez une adresse valide avec la ville, l’État et le code postal in_person_proofing.body.location.location_button: Sélectionner in_person_proofing.body.location.po_search.address_label: Adresse diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 0349e3166ef..200a772a57e 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -1224,10 +1224,13 @@ in_person_proofing.body.cta.button: 尝试亲身去 in_person_proofing.body.cta.prompt_detail: 无法在网上完成这一步骤的大多数人都能在一个参与本项目的邮局成功地证实身份。去邮局无需预约。全国各地都有参与本项目的邮局。 in_person_proofing.body.expect.heading: 去邮局后会发生什么 in_person_proofing.body.expect.info: 你去邮局后 24 小时内,我们会给你发电邮,告诉你是否成功验证了身份。 +in_person_proofing.body.location.change_location_find_other_locations: 查找其他参与本项目的邮局地点。 +in_person_proofing.body.location.change_location_heading: 需要更改你的邮局地点吗? +in_person_proofing.body.location.change_location_info_html: 你不需要创建新的条形码,你可以将这个条形码带到任何参与本项目的邮局。 %{find_other_locations_link_html} in_person_proofing.body.location.distance.one: 距离你 %{count} 英里 in_person_proofing.body.location.distance.other: 距离你 %{count} 英里 in_person_proofing.body.location.heading: 邮局信息 -in_person_proofing.body.location.info: 验证你的身份无需做预约。你可以去任何参与邮局。 +in_person_proofing.body.location.info: 验证你的身份无需做预约。 in_person_proofing.body.location.inline_error: 请输入正确地址,包括城市、州和邮编 in_person_proofing.body.location.location_button: 选择 in_person_proofing.body.location.po_search.address_label: 地址 diff --git a/spec/mailers/user_mailer_spec.rb b/spec/mailers/user_mailer_spec.rb index fef65205fe3..15a4ffb1fda 100644 --- a/spec/mailers/user_mailer_spec.rb +++ b/spec/mailers/user_mailer_spec.rb @@ -1,6 +1,8 @@ require 'rails_helper' RSpec.describe UserMailer, type: :mailer do + include ActionView::Helpers::UrlHelper + let(:user) { create(:user) } let(:email_address) { user.email_addresses.first } let(:banned_email) { 'banned_email+123abc@gmail.com' } @@ -762,7 +764,59 @@ def expect_email_body_to_have_help_and_contact_links end end - context 'For In-Person Proofing (IPP)' do + context 'Need to change location section' do + context 'when Enhanced IPP is not enabled' do + let(:is_enhanced_ipp) { false } + let(:mail) do + UserMailer.with(user: user, email_address: email_address).in_person_ready_to_verify( + enrollment: enhanced_ipp_enrollment, + is_enhanced_ipp: is_enhanced_ipp, + ) + end + it 'renders the change location heading' do + expect(mail.html_part.body).to have_content( + t('in_person_proofing.body.location.change_location_heading'), + ) + end + + it 'renders the change location info' do + expect(mail.html_part.body).to have_content( + t( + 'in_person_proofing.body.location.change_location_info_html', + find_other_locations_link_html: + t('in_person_proofing.body.location.change_location_find_other_locations'), + ), + ) + end + end + context 'when Enhanced IPP is enabled' do + let(:is_enhanced_ipp) { true } + let(:mail) do + UserMailer.with(user: user, email_address: email_address).in_person_ready_to_verify( + enrollment: enhanced_ipp_enrollment, + is_enhanced_ipp: is_enhanced_ipp, + ) + end + + it 'does not render the change location heading' do + expect(mail.html_part.body).not_to have_content( + t('in_person_proofing.body.location.change_location_heading'), + ) + end + + it 'does not render the change location info' do + expect(mail.html_part.body).not_to have_content( + t( + 'in_person_proofing.body.location.change_location_info_html', + find_other_locations_link_html: + t('in_person_proofing.body.location.change_location_find_other_locations'), + ), + ) + end + end + end + + context 'For Informed Delivery In-Person Proofing (ID-IPP)' do context 'template displays modified content' do it 'conditionally renders content in the what to expect section applicable to IPP' do aggregate_failures do diff --git a/spec/views/idv/in_person/ready_to_verify/show.html.erb_spec.rb b/spec/views/idv/in_person/ready_to_verify/show.html.erb_spec.rb index fcd6cc0592c..400994814d5 100644 --- a/spec/views/idv/in_person/ready_to_verify/show.html.erb_spec.rb +++ b/spec/views/idv/in_person/ready_to_verify/show.html.erb_spec.rb @@ -38,13 +38,6 @@ allow(view).to receive(:step_indicator_steps).and_return(step_indicator_steps) end - it 'displays a link back to the service provider' do - render - - expect(rendered).to have_content(service_provider.friendly_name) - expect(rendered).to have_css("lg-click-observer[event-name='#{sp_event_name}']") - end - it 'displays a link back to the help center' do render @@ -59,16 +52,6 @@ ) end - context 'when the user is not coming from a service provider' do - let(:service_provider) { nil } - - it 'does not display a link back to a service provider' do - render - - expect(rendered).not_to have_content('You may now close this window or') - end - end - it 'renders a cancel link' do render @@ -84,86 +67,125 @@ expect(rendered).to have_content(t('in_person_proofing.process.barcode.caption_label')) end - context 'with enrollment where selected_location_details is present' do - it 'renders a location' do - render + context 'link back to the service provider' do + context 'when the user is coming from a service provider' do + it 'displays a link back to the service provider' do + render - expect(rendered).to have_content(t('in_person_proofing.body.barcode.retail_hours')) + expect(rendered).to have_content(service_provider.friendly_name) + expect(rendered).to have_css("lg-click-observer[event-name='#{sp_event_name}']") + end end - end - context 'with enrollment where selected_location_details is not present' do - let(:selected_location_details) { nil } + context 'when the user is not coming from a service provider' do + let(:service_provider) { nil } - it 'does not render a location' do - render + it 'does not display a link back to the service provider' do + render - expect(rendered).not_to have_content(t('in_person_proofing.body.barcode.retail_hours')) + expect(rendered).not_to have_css("lg-click-observer[event-name='#{sp_event_name}']") + expect(rendered).to have_content('You may now close this window') + end end end - context 'Outage message flag' do - before(:each) do - end + context 'location section' do + context 'when selected_location_details is present' do + it 'renders a location' do + render - let(:formatted_date) { 'Tuesday, October 31' } - let(:in_person_outage_emailed_by_date) { 'November 1, 2023' } - let(:in_person_outage_expected_update_date) { 'October 31, 2023' } + expect(rendered).to have_content(t('in_person_proofing.body.barcode.retail_hours')) + end + end - it 'renders the outage alert when flag is enabled' do - allow(IdentityConfig.store).to receive(:in_person_outage_message_enabled). - and_return(true) - allow(IdentityConfig.store).to receive(:in_person_outage_emailed_by_date). - and_return(in_person_outage_emailed_by_date) - allow(IdentityConfig.store).to receive(:in_person_outage_expected_update_date). - and_return(in_person_outage_expected_update_date) + context 'when selected_location_details is not present' do + let(:selected_location_details) { nil } - render + it 'does not render a location' do + render - expect(rendered).to have_content( - t( - 'idv.failure.exceptions.in_person_outage_error_message.ready_to_verify.title', - date: formatted_date, - ), - ) + expect(rendered).not_to have_content(t('in_person_proofing.body.barcode.retail_hours')) + end end + end - it 'does not render a warning when outage dates are not included' do - allow(IdentityConfig.store).to receive(:in_person_outage_message_enabled). - and_return(true) - allow(IdentityConfig.store).to receive(:in_person_outage_emailed_by_date). - and_return('') - allow(IdentityConfig.store).to receive(:in_person_outage_expected_update_date). - and_return('') - - expect(rendered).to_not have_content( - t( - 'idv.failure.exceptions.in_person_outage_error_message.ready_to_verify.title', - date: formatted_date, - ), - ) + context 'outage alert' do + context 'when the outage message flag is enabled' do + before do + allow(IdentityConfig.store).to receive(:in_person_outage_message_enabled). + and_return(true) + end + + context 'when the outage dates are included' do + let(:formatted_date) { 'Tuesday, October 31' } + let(:in_person_outage_emailed_by_date) { 'November 1, 2023' } + let(:in_person_outage_expected_update_date) { 'October 31, 2023' } + + before do + allow(IdentityConfig.store).to receive(:in_person_outage_message_enabled). + and_return(true) + allow(IdentityConfig.store).to receive(:in_person_outage_emailed_by_date). + and_return(in_person_outage_emailed_by_date) + allow(IdentityConfig.store).to receive(:in_person_outage_expected_update_date). + and_return(in_person_outage_expected_update_date) + end + + it 'renders the outage alert' do + render + + expect(rendered).to have_content( + t( + 'idv.failure.exceptions.in_person_outage_error_message.ready_to_verify.title', + date: formatted_date, + ), + ) + end + end + + context 'when the outage dates are not included' do + before do + allow(IdentityConfig.store).to receive(:in_person_outage_message_enabled). + and_return(true) + allow(IdentityConfig.store).to receive(:in_person_outage_emailed_by_date). + and_return('') + allow(IdentityConfig.store).to receive(:in_person_outage_expected_update_date). + and_return('') + end + + it 'does not render a warning' do + render + + expect(rendered).to_not have_content( + t('idv.failure.exceptions.in_person_outage_error_message.ready_to_verify.title'), + ) + end + end end - it 'does not render the outage alert when flag is disabled' do - allow(IdentityConfig.store).to receive(:in_person_outage_message_enabled). - and_return(false) + context 'when the outage message flag is disabled' do + before do + allow(IdentityConfig.store).to receive(:in_person_outage_message_enabled). + and_return(false) + end - render + it 'does not render the outage alert' do + render - expect(rendered).not_to have_content( - t('idv.failure.exceptions.in_person_outage_error_message.ready_to_verify.title'), - ) + expect(rendered).not_to have_content( + t('idv.failure.exceptions.in_person_outage_error_message.ready_to_verify.title'), + ) + end end end - context 'For IPP (Not Enhanced IPP)' do - let(:is_enhanced_ipp) { false } - before do - @is_enhanced_ipp = false - end + context 'what to expect section' do + context 'when Enhanced IPP is not enabled' do + let(:is_enhanced_ipp) { false } + before do + @is_enhanced_ipp = is_enhanced_ipp + end - context 'template displays modified content' do - it 'conditionally renders content in the what to expect section applicable to IPP' do + it 'conditionally renders content applicable to ID-IPP' do render aggregate_failures do @@ -180,71 +202,13 @@ end end - it 'renders Questions? and Learn more link only once' do - render - - expect(rendered).to have_content(t('in_person_proofing.body.barcode.questions')).once - expect(rendered).to have_link( - t('in_person_proofing.body.barcode.learn_more'), - href: help_center_redirect_url( - category: 'verify-your-identity', - article: 'verify-your-identity-in-person', - ), - ).once - end - - it 'renders the email sent success alert' do - render - - expect(rendered).to have_content(t('in_person_proofing.body.barcode.email_sent')) - end - - it 'template does not display Enhanced In-Person Proofing specific content' do - render - - aggregate_failures do - [ - t('in_person_proofing.headings.barcode_eipp'), - t('in_person_proofing.body.barcode.eipp_tag'), - t('in_person_proofing.headings.barcode_what_to_bring'), - t('in_person_proofing.body.barcode.eipp_what_to_bring'), - t('in_person_proofing.process.eipp_bring_id.heading'), - t('in_person_proofing.process.eipp_bring_id_with_current_address.heading'), - t('in_person_proofing.process.eipp_bring_id.info'), - t('in_person_proofing.process.real_id_and_supporting_docs.heading'), - t('in_person_proofing.process.real_id_and_supporting_docs.info'), - t('in_person_proofing.process.eipp_bring_id_plus_documents.heading'), - t('in_person_proofing.process.eipp_bring_id_plus_documents.info'), - t('in_person_proofing.process.eipp_state_id_passport.heading'), - t('in_person_proofing.process.eipp_state_id_passport.info'), - t('in_person_proofing.process.eipp_state_id_military_id.heading'), - t('in_person_proofing.process.eipp_state_id_military_id.info'), - t('in_person_proofing.process.eipp_state_id_supporting_docs.heading'), - t('in_person_proofing.process.eipp_state_id_supporting_docs.info'), - t('in_person_proofing.process.state_id.heading_eipp'), - t('in_person_proofing.process.state_id.info_eipp'), - ].each do |copy| - Array(copy).each do |part| - expect(rendered).to_not have_content(part) - end - end + context 'when Enhanced IPP is enabled' do + let(:is_enhanced_ipp) { true } + before do + @is_enhanced_ipp = is_enhanced_ipp end - t('in_person_proofing.process.eipp_state_id_supporting_docs.info_list').each do |item| - expect(rendered).to_not have_content(strip_tags(item)) - end - end - end - - context 'For Enhanced In-Person Proofing (EIPP)' do - let(:is_enhanced_ipp) { true } - - before do - @is_enhanced_ipp = true - end - - context 'template displays modified content' do - it 'conditionally renders content in the what to expect section applicable to EIPP' do + it 'conditionally renders content applicable to EIPP' do render aggregate_failures do @@ -260,7 +224,9 @@ end end end + end + context 'Questions? and Learn more link' do it 'renders Questions? and Learn more link only once' do render @@ -273,74 +239,195 @@ ), ).once end + end + context 'email sent success alert' do it 'renders the email sent success alert' do render expect(rendered).to have_content(t('in_person_proofing.body.barcode.email_sent')) end + end - context 'template displays additional (EIPP specific) content' do + context 'GSA Enhanced Pilot Barcode tag' do + context 'when Enhanced IPP is enabled' do + let(:is_enhanced_ipp) { true } + before do + @is_enhanced_ipp = is_enhanced_ipp + end it 'renders GSA Enhanced Pilot Barcode tag' do render expect(rendered).to have_content(t('in_person_proofing.body.barcode.eipp_tag')) end + end + context 'when Enhanced IPP is not enabled' do + let(:is_enhanced_ipp) { false } + before do + @is_enhanced_ipp = is_enhanced_ipp + end - context 'What to bring to the Post Office section' do - it 'displays heading and body' do - render + it 'does not render GSA Enhanced Pilot Barcode tag' do + render - expect(rendered).to have_content(t('in_person_proofing.headings.barcode_what_to_bring')) - expect(rendered).to have_content(t('in_person_proofing.body.barcode.eipp_what_to_bring')) - end + expect(rendered).not_to have_content(t('in_person_proofing.body.barcode.eipp_tag')) + end + end + end - it 'renders Option 1 content' do - render + context 'What to bring to the Post Office section' do + context 'when Enhanced IPP is enabled' do + let(:is_enhanced_ipp) { true } + before do + @is_enhanced_ipp = is_enhanced_ipp + end + + it 'displays heading and body' do + render + + expect(rendered).to have_content(t('in_person_proofing.headings.barcode_what_to_bring')) + expect(rendered).to have_content(t('in_person_proofing.body.barcode.eipp_what_to_bring')) + end + + it 'renders Option 1 content' do + render - aggregate_failures do - [ - t('in_person_proofing.process.eipp_bring_id.heading'), - t('in_person_proofing.process.eipp_bring_id_with_current_address.heading'), - t('in_person_proofing.process.eipp_bring_id.info'), - t('in_person_proofing.process.real_id_and_supporting_docs.heading'), - t('in_person_proofing.process.real_id_and_supporting_docs.info'), - ].each do |copy| - Array(copy).each do |part| - expect(rendered).to have_content(part) - end + aggregate_failures do + [ + t('in_person_proofing.process.eipp_bring_id.heading'), + t('in_person_proofing.process.eipp_bring_id_with_current_address.heading'), + t('in_person_proofing.process.eipp_bring_id.info'), + t('in_person_proofing.process.real_id_and_supporting_docs.heading'), + t('in_person_proofing.process.real_id_and_supporting_docs.info'), + ].each do |copy| + Array(copy).each do |part| + expect(rendered).to have_content(part) end end + end - t('in_person_proofing.process.eipp_state_id_supporting_docs.info_list').each do |item| - expect(rendered).to have_content(strip_tags(item)) - end + t('in_person_proofing.process.eipp_state_id_supporting_docs.info_list').each do |item| + expect(rendered).to have_content(strip_tags(item)) end + end - it 'renders Option 2 content' do - render + it 'renders Option 2 content' do + render - aggregate_failures do - [ - t('in_person_proofing.process.eipp_bring_id_plus_documents.heading'), - t('in_person_proofing.process.eipp_bring_id_plus_documents.info'), - t('in_person_proofing.process.eipp_state_id_passport.heading'), - t('in_person_proofing.process.eipp_state_id_passport.info'), - t('in_person_proofing.process.eipp_state_id_military_id.heading'), - t('in_person_proofing.process.eipp_state_id_military_id.info'), - t('in_person_proofing.process.eipp_state_id_supporting_docs.heading'), - t('in_person_proofing.process.eipp_state_id_supporting_docs.info'), - ].each do |copy| - Array(copy).each do |part| - expect(rendered).to have_content(part) - end + aggregate_failures do + [ + t('in_person_proofing.process.eipp_bring_id_plus_documents.heading'), + t('in_person_proofing.process.eipp_bring_id_plus_documents.info'), + t('in_person_proofing.process.eipp_state_id_passport.heading'), + t('in_person_proofing.process.eipp_state_id_passport.info'), + t('in_person_proofing.process.eipp_state_id_military_id.heading'), + t('in_person_proofing.process.eipp_state_id_military_id.info'), + t('in_person_proofing.process.eipp_state_id_supporting_docs.heading'), + t('in_person_proofing.process.eipp_state_id_supporting_docs.info'), + ].each do |copy| + Array(copy).each do |part| + expect(rendered).to have_content(part) end end + end - t('in_person_proofing.process.eipp_state_id_supporting_docs.info_list').each do |item| - expect(rendered).to have_content(strip_tags(item)) + t('in_person_proofing.process.eipp_state_id_supporting_docs.info_list').each do |item| + expect(rendered).to have_content(strip_tags(item)) + end + end + end + + context 'when Enhanced IPP is not enabled' do + let(:is_enhanced_ipp) { false } + before do + @is_enhanced_ipp = is_enhanced_ipp + end + + it 'template does not display Enhanced In-Person Proofing what to bring content' do + render + + aggregate_failures do + [ + t('in_person_proofing.headings.barcode_eipp'), + t('in_person_proofing.headings.barcode_what_to_bring'), + t('in_person_proofing.body.barcode.eipp_what_to_bring'), + t('in_person_proofing.process.eipp_bring_id.heading'), + t('in_person_proofing.process.eipp_bring_id_with_current_address.heading'), + t('in_person_proofing.process.eipp_bring_id.info'), + t('in_person_proofing.process.real_id_and_supporting_docs.heading'), + t('in_person_proofing.process.real_id_and_supporting_docs.info'), + t('in_person_proofing.process.eipp_bring_id_plus_documents.heading'), + t('in_person_proofing.process.eipp_bring_id_plus_documents.info'), + t('in_person_proofing.process.eipp_state_id_passport.heading'), + t('in_person_proofing.process.eipp_state_id_passport.info'), + t('in_person_proofing.process.eipp_state_id_military_id.heading'), + t('in_person_proofing.process.eipp_state_id_military_id.info'), + t('in_person_proofing.process.eipp_state_id_supporting_docs.heading'), + t('in_person_proofing.process.eipp_state_id_supporting_docs.info'), + t('in_person_proofing.process.state_id.heading_eipp'), + t('in_person_proofing.process.state_id.info_eipp'), + ].each do |copy| + Array(copy).each do |part| + expect(rendered).to_not have_content(part) + end end end + + t('in_person_proofing.process.eipp_state_id_supporting_docs.info_list').each do |item| + expect(rendered).to_not have_content(strip_tags(item)) + end + end + end + end + + context 'Need to Change Location section' do + context 'when Enhanced IPP is not enabled' do + let(:is_enhanced_ipp) { false } + before do + @is_enhanced_ipp = is_enhanced_ipp + end + + it 'renders the change location heading' do + render + + expect(rendered).to have_content( + t('in_person_proofing.body.location.change_location_heading'), + ) + end + + it 'renders the change location info' do + render + + expect(rendered).to have_content( + t( + 'in_person_proofing.body.location.change_location_info_html', + find_other_locations_link_html: + t('in_person_proofing.body.location.change_location_find_other_locations'), + ), + ) + end + end + + context 'when Enhanced IPP is enabled' do + let(:is_enhanced_ipp) { true } + before do + @is_enhanced_ipp = is_enhanced_ipp + end + + it 'does not render the change location heading' do + render + + expect(rendered).not_to have_content( + t('in_person_proofing.body.location.change_location_heading'), + ) + end + + it 'does not render the change location info' do + render + + expect(rendered).not_to have_content( + t('in_person_proofing.body.location.change_location_info_html'), + ) end end end