Skip to content
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

Merged
merged 11 commits into from
May 20, 2024

Conversation

night-jellyfish
Copy link
Contributor

@night-jellyfish night-jellyfish commented May 16, 2024

🎫 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:

  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

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

  • Compare the test expectations to the corresponding sections in the above linked doc to make sure they are correct
  • Try testing out those error combos and make sure you see the expected messages

👀 Screenshots

Multiple errors for front and back:

Before:

image

After:

image

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.
@night-jellyfish night-jellyfish force-pushed the brittany/lg-12994-multiple-doc-auth-errors branch from 11fb950 to 7ef0b47 Compare May 17, 2024 16:07
@night-jellyfish night-jellyfish marked this pull request as ready for review May 17, 2024 16:34
@night-jellyfish night-jellyfish requested review from charleyf and a team May 17, 2024 16:38
Copy link
Contributor

@charleyf charleyf left a 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>
Copy link
Contributor

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 }) {
Copy link
Contributor

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>
Copy link
Contributor

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
Copy link
Contributor

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 👍

@night-jellyfish night-jellyfish merged commit 3885169 into main May 20, 2024
2 checks passed
@night-jellyfish night-jellyfish deleted the brittany/lg-12994-multiple-doc-auth-errors branch May 20, 2024 16:24
night-jellyfish added a commit that referenced this pull request May 20, 2024
[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.
night-jellyfish added a commit that referenced this pull request May 22, 2024
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]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants