From 775885be35bfd17ed0d64ad2e4e3938ef3756e71 Mon Sep 17 00:00:00 2001 From: Amir Reavis-Bey Date: Thu, 15 Feb 2024 15:28:24 -0500 Subject: [PATCH] barcode attention should only be shown when api image upload submission is successful changelog: Bug Fixes, Document Authentication, Attention with Barcode only when image upload is successful" --- app/presenters/image_upload_response_presenter.rb | 1 + .../features/idv/doc_auth/document_capture_spec.rb | 9 ++++----- ...est_credential_barcode_attention_no_address.yml | 14 ++++++++++++++ 3 files changed, 19 insertions(+), 5 deletions(-) create mode 100644 spec/fixtures/ial2_test_credential_barcode_attention_no_address.yml diff --git a/app/presenters/image_upload_response_presenter.rb b/app/presenters/image_upload_response_presenter.rb index e6476312323..b524a1f43fe 100644 --- a/app/presenters/image_upload_response_presenter.rb +++ b/app/presenters/image_upload_response_presenter.rb @@ -78,6 +78,7 @@ def attention_with_barcode? end def ocr_pii + return unless success? return unless attention_with_barcode? && @form_response.respond_to?(:pii_from_doc) @form_response.pii_from_doc&.slice(:first_name, :last_name, :dob) end diff --git a/spec/features/idv/doc_auth/document_capture_spec.rb b/spec/features/idv/doc_auth/document_capture_spec.rb index 9141c0d592d..525886c37ba 100644 --- a/spec/features/idv/doc_auth/document_capture_spec.rb +++ b/spec/features/idv/doc_auth/document_capture_spec.rb @@ -58,16 +58,15 @@ attach_images( Rails.root.join( 'spec', 'fixtures', - 'ial2_test_credential_barcode_attention_no_dob.yml' + 'ial2_test_credential_barcode_attention_no_address.yml' ), ) submit_images - expect(page).to have_content(t('doc_auth.errors.barcode_attention.heading')) - click_idv_continue - - # should show try again + expect(page).to have_content(t('doc_auth.errors.alerts.address_check')) expect(page).to have_current_path(idv_document_capture_path) + + click_try_again attach_images submit_images expect(page).to have_current_path(idv_ssn_path) diff --git a/spec/fixtures/ial2_test_credential_barcode_attention_no_address.yml b/spec/fixtures/ial2_test_credential_barcode_attention_no_address.yml new file mode 100644 index 00000000000..c32bbceb669 --- /dev/null +++ b/spec/fixtures/ial2_test_credential_barcode_attention_no_address.yml @@ -0,0 +1,14 @@ +document: + first_name: Jane + last_name: Doe + middle_name: Q + city: Bayside + state: NY + zipcode: '11364' + dob: 10/06/1938 + phone: +1 314-555-1212 + state_id_jurisdiction: 'NY' + state_id_number: 'S59397998' +failed_alerts: + - name: 2D Barcode Read + result: Attention \ No newline at end of file