* test(cover-image): uses correct queries for ui unit tests * test(form): replaces queries to getByRole and adds expect where necessary * feat(help): adds expect assert and uses within to test inside specific block * feat(image-uploader): uses correct queries to validate behaviour * test: corrects queries and adds expect assertions to some unit tests
20 lines
604 B
JavaScript
20 lines
604 B
JavaScript
import { h } from 'preact';
|
|
import { render } from '@testing-library/preact';
|
|
import { axe } from 'jest-axe';
|
|
import '@testing-library/jest-dom';
|
|
import { Close } from '../Close';
|
|
|
|
describe('<Close />', () => {
|
|
it('should have no a11y violations', async () => {
|
|
const { container } = render(<Close />);
|
|
const results = await axe(container);
|
|
|
|
expect(results).toHaveNoViolations();
|
|
});
|
|
|
|
it('renders the close button', () => {
|
|
const { getByRole } = render(<Close />);
|
|
const icon = getByRole('button', { name: /Close the editor/i });
|
|
expect(icon).toBeInTheDocument();
|
|
});
|
|
});
|