Add first accessibility tests

This commit is contained in:
Alejandro Celaya
2023-09-30 10:20:28 +02:00
parent ed83d4e842
commit 6d1d3c021a
17 changed files with 168 additions and 22 deletions

View File

@@ -1,10 +1,13 @@
import { render, screen } from '@testing-library/react';
import { MemoryRouter } from 'react-router';
import { NotFound } from '../../src/common/NotFound';
import { checkAccessibility } from '../__helpers__/accessibility';
describe('<NotFound />', () => {
const setUp = (props = {}) => render(<MemoryRouter><NotFound {...props} /></MemoryRouter>);
it('passes a11y checks', () => checkAccessibility(setUp()));
it('shows expected error title', () => {
setUp();
expect(screen.getByText('Oops! We could not find requested route.')).toBeInTheDocument();