-
Notifications
You must be signed in to change notification settings - Fork 161
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
1 parent
2123535
commit a13f6e4
Showing
1 changed file
with
11 additions
and
18 deletions.
There are no files selected for viewing
29 changes: 11 additions & 18 deletions
29
packages/fuselage/src/components/SideBarV2/SideBar.spec.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 |
---|---|---|
@@ -1,26 +1,19 @@ | ||
import { composeStories } from '@storybook/react'; | ||
import { render } from '@testing-library/react'; | ||
import { axe } from 'jest-axe'; | ||
|
||
import { render } from '../../testing'; | ||
import * as stories from './SideBar.stories'; | ||
|
||
const testCases = Object.values(composeStories(stories)); | ||
const { Default } = composeStories(stories); | ||
|
||
describe('[SideBar Component]', () => { | ||
test.each(testCases)( | ||
`renders %s without crashing`, | ||
async (_storyname, Story) => { | ||
render(<Story />); | ||
} | ||
); | ||
describe('[Sidebar Component]', () => { | ||
it('renders without crashing', () => { | ||
render(<Default />); | ||
}); | ||
it('should have no a11y violations', async () => { | ||
const { container } = render(<Default />); | ||
|
||
test.each(testCases)( | ||
'%s should have no a11y violations', | ||
async (_storyname, Story) => { | ||
const { container } = render(<Story />); | ||
|
||
const results = await axe(container); | ||
expect(results).toHaveNoViolations(); | ||
} | ||
); | ||
const results = await axe(container); | ||
expect(results).toHaveNoViolations(); | ||
}); | ||
}); |