generated from DTS-STN/next-template
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
69 changed files
with
2,137 additions
and
2,441 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
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 |
---|---|---|
|
@@ -43,6 +43,9 @@ yarn-error.log* | |
.env | ||
.env.local | ||
|
||
#cert | ||
env.crt | ||
|
||
# typescript | ||
*.tsbuildinfo | ||
next-env.d.ts | ||
|
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 was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import '@testing-library/jest-dom' | ||
import { render, screen, waitFor } from '@testing-library/react' | ||
import IdleTimeout from '../../components/IdleTimeout' | ||
|
||
jest.mock('next/router', () => ({ | ||
useRouter: () => ({}), | ||
})) | ||
|
||
describe('IdleTimeout', () => { | ||
it('renders with modal opened after 1 second timeout', async () => { | ||
render( | ||
<IdleTimeout | ||
promptBeforeIdle={4000} | ||
timeout={5000} | ||
locale="en" | ||
refPageAA="test" | ||
/>, | ||
) | ||
await waitFor( | ||
() => { | ||
const modal = screen.getByTestId('modal') | ||
expect(modal).toBeInTheDocument() | ||
}, | ||
{ timeout: 3000 }, | ||
) | ||
}) | ||
}) |
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,40 @@ | ||
import { render, screen } from '@testing-library/react' | ||
import '@testing-library/jest-dom' | ||
import { axe, toHaveNoViolations } from 'jest-axe' | ||
import InfoMessage from '../../components/InfoMessage' | ||
|
||
expect.extend(toHaveNoViolations) | ||
|
||
describe('InfoMessage', () => { | ||
it('renders InfoMessage', () => { | ||
render( | ||
<InfoMessage | ||
data-testid={'label'} | ||
messageText={'messageText'} | ||
messageLinkText={'messageLinkText'} | ||
icon={'arrow-up-right-from-square'} | ||
></InfoMessage>, | ||
) | ||
const label = screen.getAllByTestId('label') | ||
const messageText = screen.getByText('messageText') | ||
const messageLinkText = screen.getByText('messageLinkText') | ||
|
||
expect.arrayContaining(label) | ||
expect(messageText).toBeInTheDocument() | ||
expect(messageLinkText).toBeInTheDocument() | ||
}) | ||
|
||
it('has no a11y viollations', async () => { | ||
const { container } = render( | ||
<InfoMessage | ||
label={'label'} | ||
messageText={'messageText'} | ||
messageLinkText={'messageLinkText'} | ||
messageLinkHref={'messageLinkHref'} | ||
icon={'arrow-up-right-from-square'} | ||
></InfoMessage>, | ||
) | ||
const results = await axe(container) | ||
expect(results).toHaveNoViolations() | ||
}) | ||
}) |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.