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

@@ -3,6 +3,7 @@ import { fromPartial } from '@total-typescript/shoehorn';
import { useParams } from 'react-router-dom';
import { ShlinkWebComponentContainerFactory } from '../../src/common/ShlinkWebComponentContainer';
import type { NonReachableServer, NotFoundServer, SelectedServer } from '../../src/servers/data';
import { checkAccessibility } from '../__helpers__/accessibility';
vi.mock('react-router-dom', async () => ({
...(await vi.importActual<any>('react-router-dom')),
@@ -24,6 +25,8 @@ describe('<ShlinkWebComponentContainer />', () => {
(useParams as any).mockReturnValue({ serverId: 'abc123' });
});
it('passes a11y checks', () => checkAccessibility(setUp(fromPartial({ version: '3.0.0' }))));
it('shows loading indicator while loading server', () => {
setUp(null);