diff --git a/app/javascript/packages/document-capture/components/acuant-capture.tsx b/app/javascript/packages/document-capture/components/acuant-capture.tsx index a0a498a321e..9eb95223b63 100644 --- a/app/javascript/packages/document-capture/components/acuant-capture.tsx +++ b/app/javascript/packages/document-capture/components/acuant-capture.tsx @@ -72,6 +72,11 @@ interface ImageAnalyticsPayload { * */ failedImageResubmission: boolean; + + /** + * Image file name + */ + fileName?: string; } interface AcuantImageAnalyticsPayload extends ImageAnalyticsPayload { @@ -408,8 +413,8 @@ function AcuantCapture( source: 'upload', size: nextValue.size, failedImageResubmission: hasFailed, + fileName: nextValue.name, }); - trackEvent( name === 'selfie' ? 'idv_selfie_image_added' : `IdV: ${name} image added`, analyticsPayload, diff --git a/spec/forms/idv/api_image_upload_form_spec.rb b/spec/forms/idv/api_image_upload_form_spec.rb index 4733457336a..99ecec7ee91 100644 --- a/spec/forms/idv/api_image_upload_form_spec.rb +++ b/spec/forms/idv/api_image_upload_form_spec.rb @@ -28,11 +28,26 @@ let(:back_image) { DocAuthImageFixtures.document_back_image_multipart } let(:selfie_image) { nil } let(:liveness_checking_required) { false } + let(:front_image_file_name) { 'front.jpg' } + let(:back_image_file_name) { 'back.jpg' } + let(:selfie_image_file_name) { 'selfie.jpg' } let(:front_image_metadata) do - { width: 40, height: 40, mimeType: 'image/png', source: 'upload' } + { + width: 40, + height: 40, + mimeType: 'image/png', + source: 'upload', + fileName: front_image_file_name, + } end let(:back_image_metadata) do - { width: 20, height: 20, mimeType: 'image/png', source: 'upload' } + { + width: 20, + height: 20, + mimeType: 'image/png', + source: 'upload', + fileName: back_image_file_name, + } end let(:selfie_image_metadata) { nil } let!(:document_capture_session) { DocumentCaptureSession.create!(user: create(:user)) } @@ -110,10 +125,22 @@ context 'images sourced by acuant sdk' do let(:front_image_metadata) do - { width: 40, height: 40, mimeType: 'image/png', source: 'acuant' } + { + width: 40, + height: 40, + mimeType: 'image/png', + source: 'acuant', + fileName: front_image_file_name, + } end let(:back_image_metadata) do - { width: 20, height: 20, mimeType: 'image/png', source: 'acuant' } + { + width: 20, + height: 20, + mimeType: 'image/png', + source: 'acuant', + fileName: back_image_file_name, + } end it 'is valid' do expect(form.valid?).to eq(true) @@ -121,7 +148,13 @@ context 'selfie is uploaded' do let(:selfie_image_metadata) do - { width: 40, height: 40, mimeType: 'image/png', source: 'upload' } + { + width: 40, + height: 40, + mimeType: 'image/png', + source: 'upload', + fileName: selfie_image_file_name, + } end it 'is invalid' do expect(form.valid?).to eq(false) @@ -183,12 +216,14 @@ mimeType: 'image/png', source: 'upload', width: 20, + fileName: back_image_file_name, }, front: { height: 40, mimeType: 'image/png', source: 'upload', width: 40, + fileName: front_image_file_name, }, }, image_metrics: nil, @@ -294,12 +329,14 @@ mimeType: 'image/png', source: 'upload', width: 20, + fileName: back_image_file_name, }, front: { height: 40, mimeType: 'image/png', source: 'upload', width: 40, + fileName: front_image_file_name, }, selfie: { height: 10,