Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions app/controllers/idv/verify_info_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def show
return
end

@had_barcode_read_failure = flow_session[:had_barcode_read_failure]
process_async_state(load_async_state)
end

Expand Down
18 changes: 18 additions & 0 deletions app/views/idv/verify_info/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,24 @@ locals:
<!-- Needed by form steps wait javascript -->
</div>

<% if @had_barcode_read_failure %>
<%= render AlertComponent.new(
type: :warning,
class: 'margin-bottom-4',
text_tag: 'div',
) do %>
<%= t(
'doc_auth.headings.capture_scan_warning_html',
link: render(
FormLinkComponent.new(
href: idv_doc_auth_step_path(step: :redo_document_capture),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eventually, redo_document_capture will need to be its own controller and this link will need to change. Looks good for now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, we may want to throw together a story for that 🤔

method: :put,
).with_content(t('doc_auth.headings.capture_scan_warning_link')),
),
) %>
<% end %>
<% end %>

<% title t('titles.idv.verify_info') %>

<%= render PageHeadingComponent.new.with_content(t('headings.verify')) %>
Expand Down
61 changes: 61 additions & 0 deletions spec/features/idv/actions/redo_document_capture_action_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,66 @@
expect(page).not_to have_css('[role="status"]')
end
end

context 'with the doc_auth_verify_info_controller_enabled flag enabled' do
before do
allow(IdentityConfig.store).to receive(:doc_auth_verify_info_controller_enabled).
and_return(true)
end

it 'shows a warning message to allow the user to return to upload new images' do
warning_link_text = t('doc_auth.headings.capture_scan_warning_link')

expect(page).to have_css(
'[role="status"]',
text: t('doc_auth.headings.capture_scan_warning_html', link: warning_link_text),
)
click_link warning_link_text

expect(current_path).to eq(idv_doc_auth_upload_step)
complete_upload_step
DocAuth::Mock::DocAuthMockClient.reset!
attach_and_submit_images

expect(page).to have_content(t('headings.verify'))
check t('forms.ssn.show')
expect(page).to have_content(DocAuthHelper::SSN_THAT_FAILS_RESOLUTION)
expect(page).not_to have_css('[role="status"]')
end

it 'shows a troubleshooting option to allow the user to return to upload new images' do
click_idv_continue

expect(page).to have_link(
t('idv.troubleshooting.options.add_new_photos'),
href: idv_doc_auth_step_path(step: :redo_document_capture),
)

click_link t('idv.troubleshooting.options.add_new_photos')

expect(current_path).to eq(idv_doc_auth_upload_step)
end

context 'on mobile', driver: :headless_chrome_mobile do
it 'shows a warning message to allow the user to return to upload new images' do
warning_link_text = t('doc_auth.headings.capture_scan_warning_link')

expect(page).to have_css(
'[role="status"]',
text: t('doc_auth.headings.capture_scan_warning_html', link: warning_link_text),
)
click_link warning_link_text

expect(current_path).to eq(idv_doc_auth_document_capture_step)
DocAuth::Mock::DocAuthMockClient.reset!
attach_and_submit_images

expect(page).to have_content(t('headings.verify'))
check t('forms.ssn.show')
expect(page).to have_content(DocAuthHelper::SSN_THAT_FAILS_RESOLUTION)
expect(page).not_to have_css('[role="status"]')
end
end
end
end
end