-
Notifications
You must be signed in to change notification settings - Fork 111
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
LG-12994: fix messages when there are multiple doc auth errors #10635
LG-12994: fix messages when there are multiple doc auth errors #10635
Conversation
This adds specs for 1. when there are multiple doc auth errors on front and back 2. when there are multiple front doc auth errors 3. when there are multiple back doc auth errors It also updates the previously existing tests to check for the rate limit message, as when I was working on the rate limit message change I found sometimes I had the message showing twice or the wrong message. So I wanted to make sure that the correct message was showing in those tests as well.
This reverts a change I made in #10450 that turned out to be the wrong change.
Our previous logic for the subheading was too strict and didn't show when selfie had errors. But really we want this h2 to show whever there is a corresponding h2 in the ipp section to balance out the html structure and make it more accessible.
After discussing this in the error doc, we found that we: - always want the rate limit message to show - do not know the logic behind showing one message versus the other, and would like to opt for the one that is more clear To that end, I moved the logic for the rate limit message up a level and out of so many conditionals. This ended up being a bigger change than I expected as so many tests relied on the place where it was previously being called, but I think it simplifies the code.
Recently this text was changed, and when trying to use the same test helper as in previous specs, it wouldn't work. This change updates the helper to be able to navigate the features enabled.
Because we decided to consolidate and only use one of the rate limit messages, we no longer use this string.
…r case of multiple errors
11fb950
to
7ef0b47
Compare
spec/fixtures/ial2_test_credential_multiple_doc_auth_failures_back_side_only.yml
Show resolved
Hide resolved
spec/fixtures/ial2_test_credential_multiple_doc_auth_failures_front_side_only.yml
Show resolved
Hide resolved
…back_side_only.yml Co-authored-by: Amir Reavis-Bey <[email protected]>
…front_side_only.yml Co-authored-by: Amir Reavis-Bey <[email protected]>
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.
I've read through the commits, code, and specs.
- The FE/BE code changes look correct to me based on the requirements.
- The spec changes also look correct, though I wasn't able to fully work through all of them. The code changes are simple and supported by the spec changes.
- The scope of doing the manual testing seemed too big to do every option. I tried a few scenarios that would have failed in
main
and they were correct.
isFailedDocType={isFailedDocType} | ||
isFailedSelfie={isFailedSelfie} | ||
isFailedSelfieLivenessOrQuality={isFailedSelfieLivenessOrQuality} | ||
altIsFailedSelfieDontIncludeAttempts | ||
altFailedDocTypeMsg={isFailedDocType ? t('doc_auth.errors.doc.wrong_id_type_html') : null} | ||
hasDismissed={hasDismissed} | ||
/> | ||
<p> |
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.
Always show on the re-upload page 👍
!isFailedDocType && | ||
!isFailedSelfieLivenessOrQuality && | ||
!isFailedSelfie; | ||
function getSubheading({ nonIppOrFailedResult, t }) { |
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.
It's nice how much simpler this is.
/> | ||
</p> | ||
)} | ||
<p> |
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.
Always show on the interstitial page before going back to the reupload page 👍
def self.general_error(liveness_enabled) | ||
liveness_enabled ? Errors::GENERAL_ERROR_LIVENESS : Errors::GENERAL_ERROR | ||
def self.general_error(_liveness_enabled) | ||
Errors::GENERAL_ERROR |
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.
Simplify, only use the GENERAL_ERROR
now 👍
app/javascript/packages/document-capture/components/unknown-error.tsx
Outdated
Show resolved
Hide resolved
[skip changelog] A change requested in [10635](#10635 (comment)). We are not changing the general error message when liveness is enabled, so we do not need to pass it in as a parameter.
A change requested in [10635](#10635 (comment)). We are not changing the general error message when liveness is enabled, so we do not need to pass it in as a parameter. [skip changelog]
🎫 Ticket
LG-12994
🛠 Summary of changes
Adding tests and updating code to match the expectations in our error documentation for conditions where we have multiple failures:
and IPP is enabled.
This is likely easiest to review in commits:
(Each commit has a description with more information about the change)
📜 Testing Plan
👀 Screenshots
Multiple errors for front and back:
Before:
After: