Skip to content

Commit

Permalink
Added accesibility test
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashwathi23 committed Sep 30, 2024
1 parent a13478f commit e6dbfc0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/components/Accordion/Accordion.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { screen, fireEvent } from '@testing-library/react';
import { renderWithDeps } from '../../../jest.utils';
import { Accordion } from './Accordion';
import { axe } from 'jest-axe';

describe('<Accordion />', () => {
it('renders', () => {
Expand All @@ -23,6 +24,13 @@ describe('<Accordion />', () => {
fireEvent.click(titleElement);
expect(contentElement).not.toBeVisible();
});

it('has no accessibility violations', async () => {
const { container } = renderWithDeps(<Accordion items={[{ title: 'Title', content: 'Content' }]} />);
const results = await axe(container);

expect(results).toHaveNoViolations();
});
});


0 comments on commit e6dbfc0

Please sign in to comment.