-
Notifications
You must be signed in to change notification settings - Fork 166
LG-13009 - consolidate poor quality and not live messaging #10536
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
dce6a0f
resolve conflict encountered during main rebase
amirbey 8ea663f
consolidate selfie not_live and poor_quality i18n
amirbey 0126454
update spec key for liveness error message
amirbey ca63bcc
[skip changelog]
amirbey 33379b8
happy linting
amirbey 130e41c
remove dup tests and add scenarios
amirbey 148fc30
key no longer exists
amirbey File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,20 +5,16 @@ module SelfieConcern | |
| extend ActiveSupport::Concern | ||
| def selfie_live? | ||
| portrait_error = get_portrait_error(portrait_match_results) | ||
| return true if portrait_error.nil? || portrait_error.blank? | ||
| return true if portrait_error.blank? | ||
| !error_is_not_live(portrait_error) | ||
| end | ||
|
|
||
| def selfie_quality_good? | ||
| portrait_error = get_portrait_error(portrait_match_results) | ||
| return true if portrait_error.nil? || portrait_error.blank? | ||
| return true if portrait_error.blank? | ||
| !error_is_poor_quality(portrait_error) | ||
| end | ||
|
|
||
| def error_is_success(error_message) | ||
|
||
| error_message == ERROR_TEXTS[:success] | ||
| end | ||
|
|
||
| def error_is_not_live(error_message) | ||
| error_message == ERROR_TEXTS[:not_live] | ||
| end | ||
|
|
@@ -31,7 +27,7 @@ def selfie_check_performed? | |
| SELFIE_PERFORMED_STATUSES.include?(selfie_status) | ||
| end | ||
|
|
||
| private | ||
| private | ||
|
|
||
| SELFIE_PERFORMED_STATUSES = %i[success fail].freeze | ||
|
|
||
|
|
@@ -45,5 +41,5 @@ def selfie_check_performed? | |
| def get_portrait_error(portrait_match_results) | ||
| portrait_match_results&.with_indifferent_access&.dig(:FaceErrorMessage) | ||
| end | ||
| end | ||
| end | ||
| end | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -153,7 +153,7 @@ | |
| end | ||
| end | ||
|
|
||
| shared_examples_for 'selfie image re-upload not allowed' do | ||
| shared_examples_for 'document and selfie images re-upload not allowed' do | ||
| it 'stops user submitting the same images again' do | ||
| expect(fake_analytics).to have_logged_event( | ||
| 'IdV: doc auth document_capture visited', | ||
|
|
@@ -240,7 +240,7 @@ | |
| end | ||
|
|
||
| context 'when selfie is enabled' do | ||
| context 'error due to data issue with 2xx status code', allow_browser_log: true do | ||
| context 'when doc auth is success and face match fails (2xx)', allow_browser_log: true do | ||
| before do | ||
| expect(FeatureManagement).to receive(:idv_allow_selfie_check?).at_least(:once). | ||
| and_return(true) | ||
|
|
@@ -257,14 +257,14 @@ | |
| sleep(10) | ||
| end | ||
|
|
||
| it_behaves_like 'selfie image re-upload not allowed' | ||
| it_behaves_like 'document and selfie images re-upload not allowed' | ||
|
|
||
| it 'shows current existing header' do | ||
| expect_doc_capture_page_header(t('doc_auth.headings.review_issues')) | ||
| end | ||
| end | ||
|
|
||
| context 'when doc auth is success and portrait match fails', allow_browser_log: true do | ||
| context 'when doc auth passes and portrait match is not live', allow_browser_log: true do | ||
| before do | ||
| expect(FeatureManagement).to receive(:idv_allow_selfie_check?).at_least(:once). | ||
| and_return(true) | ||
|
|
@@ -273,7 +273,7 @@ | |
| start_idv_from_sp(biometric_comparison_required: true) | ||
| sign_in_and_2fa_user | ||
| complete_doc_auth_steps_before_document_capture_step | ||
| mock_doc_auth_success_face_match_fail | ||
| mock_doc_auth_pass_and_portrait_match_not_live | ||
| attach_images | ||
| attach_selfie | ||
| submit_images | ||
|
|
@@ -307,7 +307,7 @@ | |
| expect(page).to have_css( | ||
| '.usa-error-message[role="alert"]', | ||
| text: t('doc_auth.errors.doc.resubmit_failed_image'), | ||
| count: 3, | ||
| count: 1, | ||
| ) | ||
| end | ||
| end | ||
|
|
@@ -368,15 +368,15 @@ | |
| start_idv_from_sp(biometric_comparison_required: true) | ||
| sign_in_and_2fa_user | ||
| complete_doc_auth_steps_before_document_capture_step | ||
| mock_doc_auth_success_face_match_fail | ||
| mock_doc_auth_fail_face_match_fail | ||
|
||
| attach_images | ||
| attach_selfie | ||
| submit_images | ||
| click_try_again | ||
| sleep(10) | ||
| end | ||
|
|
||
| it_behaves_like 'selfie image re-upload not allowed' | ||
| it_behaves_like 'document and selfie images re-upload not allowed' | ||
| end | ||
|
|
||
| context 'when pii validation fails', allow_browser_log: true do | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TIL
blankincludesnil!