Skip to content

Commit

Permalink
Updated to implement jest-axe
Browse files Browse the repository at this point in the history
  • Loading branch information
Renurose committed Oct 2, 2024
1 parent cfe393e commit 4a6cf9e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/components/Tooltip/Tooltip.test.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
import { render } from '@testing-library/react';
import { Tooltip } from './Tooltip';
import { axe } from 'jest-axe';

describe('<Tooltip />', () => {
it('renders the tooltip component', () => {
const { getByText } = render(<Tooltip text="Hover over me" tooltip="Tooltip text" />);
expect(getByText('Hover over me')).toBeInTheDocument();
});

it('has no accessibility violations', async () => {
const { container } = render(<Tooltip text="Hover over me" tooltip="Tooltip text" />);
const results = await axe(container);

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

0 comments on commit 4a6cf9e

Please sign in to comment.