-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MCR-3849 Fix session timeout (#2719)
* Bring back changes from PR #2159 * Cleanup modals - inherit from base Modal - create SessionTimeoutModal as own component - simplify styles - removing V2 naming from UnlockResubmitModal * Add IdleTimer - add to package.json - remove session timeout custom timekeeping, props from AuthContext - add IdleTimer to AuthenticatedRouteWrapper - start to add tests * Get existing tests passing * Add more mocked out tests * Handle cases where timeout countdown and session duration are set to incompatible values * Fix countdown * Add cross-tab support * Get s3Context to manually check auth if it fails and user logged out * Fixup AuthneticatedRouteWrapper tests * Write more unit tests, mock out more tests as well to write * Get remaining AuthenticatedRouteWrapper tests passing * Add back feature flag handling for showing the session expiration modal * lint changed files * Create ModalOpenButton and store activModalID in page context * Get only one modal at a time behavior working * Get only one modal at a time behavior working * Add more async handling - try to address CI only unit test flakes * Lint cleanup * Get doubleclick bug addressed * Code review comments and cleanup * Refactor cognitoAuth to return Errors, unify logout handling for various cases * make modal close more snappy * cleanup * Don't allow continue session if timer elapsed (but logout failed due to machine sleep * Also update copy when session expired but modal still open
- Loading branch information
Showing
35 changed files
with
837 additions
and
664 deletions.
There are no files selected for viewing
This file contains 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 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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 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 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 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 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 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
19 changes: 19 additions & 0 deletions
19
services/app-web/src/components/Modal/ModalOpenButton/ModalOpenButton.test.tsx
This file contains 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,19 @@ | ||
import { screen} from '@testing-library/react' | ||
import { renderWithProviders } from '../../../testHelpers' | ||
import { ModalOpenButton } from './ModalOpenButton' | ||
import { createRef} from 'react' | ||
import { type ModalRef } from '@trussworks/react-uswds' | ||
|
||
describe('ModalOpenButton', () => { | ||
it('renders without errors', () => { | ||
const testRef = createRef<ModalRef>() | ||
renderWithProviders( | ||
<ModalOpenButton id='123' modalRef={testRef}>submit 123</ModalOpenButton> | ||
) | ||
expect( | ||
screen.getByRole('button', { | ||
name: 'submit 123', | ||
}) | ||
).toBeInTheDocument() | ||
}) | ||
}) |
Oops, something went wrong.