-
Notifications
You must be signed in to change notification settings - Fork 166
LG-7943: Avoid showing in-person option for field validation errors #7254
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
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 |
|---|---|---|
|
|
@@ -488,7 +488,7 @@ describe('document-capture/components/document-capture', () => { | |
| context('in person steps', () => { | ||
| it('renders the step indicator', async () => { | ||
| const endpoint = '/upload'; | ||
| const { getByLabelText, getByText, findByText } = render( | ||
| const { getByLabelText, getByText, queryByText, findByText } = render( | ||
| <UploadContextProvider upload={httpUpload} endpoint={endpoint}> | ||
| <ServiceProviderContextProvider value={{ isLivenessRequired: false }}> | ||
| <FlowContext.Provider | ||
|
|
@@ -514,6 +514,10 @@ describe('document-capture/components/document-capture', () => { | |
| json: () => ({ success: false, remaining_attempts: 1, errors: [{}] }), | ||
| }); | ||
|
|
||
| expect(queryByText('idv.troubleshooting.options.verify_in_person')).not.to.exist(); | ||
| await userEvent.click(getByText('forms.buttons.submit.default')); | ||
| expect(queryByText('idv.troubleshooting.options.verify_in_person')).not.to.exist(); | ||
|
Comment on lines
+517
to
+519
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Test expanded to capture bug
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I'd contemplated not including any spec coverage here, since the way it had been implemented was as as additive feature of the documents step, and ideally I'd be removing whichever spec had asserted its presence, but one did not exist. But with all the different conditions involved in rendering troubleshooting options, I figured it wouldn't hurt to check that it's not visible when we're not expecting it to be. |
||
|
|
||
| const frontImage = getByLabelText('doc_auth.headings.document_capture_front'); | ||
| const backImage = getByLabelText('doc_auth.headings.document_capture_back'); | ||
| await userEvent.upload(frontImage, validUpload); | ||
|
|
||
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 wonder if
hasErrorsshould be renamed to something more specific to IPPhasDocCaptureErrorsor somethingThere 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 was on the fence about making some further revisions to the props, because I also think there's some redundancy between
showInPersonOptionandhasErrors, at least in how they're both currently used exclusively in determining whether to show in-person troubleshooting options.identity-idp/app/javascript/packages/document-capture/components/document-capture-troubleshooting-options.tsx
Lines 26 to 34 in c2a3697
For example, we could collapse them to a single prop, and maybe name it in such a way that allows for future off-ramp alternative proofing options to use (e.g.
showAlternativeProofingOptions), especially since we're also still consideringinPersonURLto control whether the feature is available for the current service provider.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 gave this a shot in dfad071.
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.
Love it! Way more semantic. Ty.