Skip to content

Commit

Permalink
tests: fix SideBar V2 tests
Browse files Browse the repository at this point in the history
  • Loading branch information
juliajforesti committed Aug 15, 2024
1 parent 2123535 commit a13f6e4
Showing 1 changed file with 11 additions and 18 deletions.
29 changes: 11 additions & 18 deletions packages/fuselage/src/components/SideBarV2/SideBar.spec.tsx
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();
});
});

0 comments on commit a13f6e4

Please sign in to comment.