-
Notifications
You must be signed in to change notification settings - Fork 166
LG-5258: Allow users to start over IAL2 verification after clicking Cancel #6542
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
10 commits
Select commit
Hold shift + click to select a range
72f6d2a
LG-5258: Allow users to start over IAL2 verification after clicking C…
aduth 4208a1e
Remove reference to "Start Over" link
aduth b55208b
Remove unnecessary references to "Start Over URL"
aduth 5eaaf7e
Rename click_spinner_button to click_spinner_button_and_wait
aduth 276fb84
Try simplified click_idv_continue
aduth 9164861
Update link sent spec to start over via cancel screen
aduth 9667dca
Wait for spinner button on account page click
aduth ed70cea
Remove IAL2 cancel spec from ial2_sso_spec
aduth 23f39c7
Update Brakeman to ignore parameter value in render path
aduth b3652fe
Normalize YAML
aduth 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| import { render } from '@testing-library/react'; | ||
| import PageFooter from './page-footer'; | ||
|
|
||
| describe('PageFooter', () => { | ||
| it('renders its children content', () => { | ||
| const { getByText } = render(<PageFooter>Content</PageFooter>); | ||
|
|
||
| expect(getByText('Content')).to.exist(); | ||
| }); | ||
| }); |
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 |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| import type { ReactNode } from 'react'; | ||
|
|
||
| interface PageFooterProps { | ||
| /** | ||
| * Footer contents. | ||
| */ | ||
| children: ReactNode; | ||
| } | ||
|
|
||
| function PageFooter({ children }: PageFooterProps) { | ||
| return ( | ||
| <div className="margin-top-4 padding-top-2 border-top border-primary-light">{children}</div> | ||
| ); | ||
| } | ||
|
|
||
| export default PageFooter; |
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
22 changes: 0 additions & 22 deletions
22
app/javascript/packages/document-capture/components/start-over-or-cancel.spec.tsx
This file was deleted.
Oops, something went wrong.
11 changes: 0 additions & 11 deletions
11
app/javascript/packages/document-capture/components/start-over-or-cancel.tsx
This file was deleted.
Oops, something went wrong.
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 |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| import { render } from '@testing-library/react'; | ||
| import FlowContext from './context/flow-context'; | ||
| import Cancel from './cancel'; | ||
|
|
||
| describe('Cancel', () => { | ||
| it('renders cancel link', () => { | ||
| const { queryByText } = render(<Cancel />); | ||
|
|
||
| expect(queryByText('links.cancel')).to.exist(); | ||
| }); | ||
|
|
||
| context('with flow context', () => { | ||
| it('renders links with current step', () => { | ||
| const { getByText } = render( | ||
| <FlowContext.Provider | ||
| value={{ | ||
| cancelURL: 'http://example.test/cancel', | ||
| currentStep: 'one', | ||
| basePath: '', | ||
| inPersonURL: null, | ||
| onComplete() {}, | ||
| }} | ||
| > | ||
| <Cancel /> | ||
| </FlowContext.Provider>, | ||
| ); | ||
|
|
||
| const cancelLink = getByText('links.cancel') as HTMLAnchorElement; | ||
| expect(cancelLink.getAttribute('href')).to.equal('http://example.test/cancel?step=one'); | ||
| }); | ||
| }); | ||
| }); |
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 |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| import { useContext } from 'react'; | ||
| import { useI18n } from '@18f/identity-react-i18n'; | ||
| import { addSearchParams } from '@18f/identity-url'; | ||
| import { PageFooter } from '@18f/identity-components'; | ||
| import FlowContext from './context/flow-context'; | ||
|
|
||
| function Cancel() { | ||
| const { currentStep: step, cancelURL } = useContext(FlowContext); | ||
| const { t } = useI18n(); | ||
|
|
||
| return ( | ||
| <PageFooter> | ||
| <a href={addSearchParams(cancelURL, { step })}>{t('links.cancel')}</a> | ||
| </PageFooter> | ||
| ); | ||
| } | ||
|
|
||
| export default Cancel; |
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
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.
Initially I wanted this to just be a plain redirect, but since this is submitted as a form, the redirect would be blocked due to CSP. Another option could be to have this be a
GETrequest, but I think it makes sense the way it's implemented now, since it is technically a destructive action (cancelling = "destroying" the session).