-
Notifications
You must be signed in to change notification settings - Fork 166
LG 10021 hide error after successful webauth authentication #8678
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
Changes from all commits
726a717
ef81e7f
21b0b8a
7c52b31
3c7fda6
b052e75
f29e4ee
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -49,4 +49,19 @@ | |
| expect(page).to have_content(t('errors.general')) | ||
| expect(page).to have_current_path(login_two_factor_webauthn_path) | ||
| end | ||
|
|
||
| it 'does not show error after successful challenge/secret reattempt' do | ||
| mock_webauthn_verification_challenge | ||
|
|
||
| sign_in_user(webauthn_configuration.user) | ||
| # click the next button or cancel from the browser dialog | ||
| click_button t('forms.buttons.continue') | ||
|
|
||
| expect(page).to have_content(t('errors.general')) | ||
|
|
||
| mock_press_button_on_hardware_key_on_verification | ||
| click_button t('forms.buttons.continue') | ||
|
|
||
| expect(page).to_not have_content(t('errors.general')) | ||
|
||
| end | ||
| end | ||
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.
Technically we're not checking if it's shown, since the element will always exist in the markup, and we're removing it whether or not it's visible. To that point, we may be able to even go as far to assume the element exists and assign the variable above using the TypeScript non-null assertion operator, similar to what we're doing with
webauthnInProgressContainerandwebauthnSuccessContainervariables before it.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 had encountered unwanted behavior where the user not clicking cancel initially got an error then had to re-attempt in order to authenticate. I could not discern why but adding the check with that if statement fixed it.
The element with the class .usa-alert--error gets inserted as that view loads and if it needs to display the error. If there's no error that element doesn't show up in the DOM.
Would it be more preferable to use a non-null operator?