docbrown/app/javascript/chat/__tests__/alert.test.jsx
Katie Davis 76453b41fb
Updates ESLint rules to error on default imports (#12512)
* add rule

* add named imports

* more missed files

* so many files
2021-02-02 10:24:03 -05:00

27 lines
699 B
JavaScript

import { h } from 'preact';
import { render } from '@testing-library/preact';
import { axe } from 'jest-axe';
import { Alert } from '../alert';
describe('<Alert />', () => {
it('should have no a11y violations', async () => {
const { container } = render(<Alert showAlert />);
const results = await axe(container);
expect(results).toHaveNoViolations();
});
it('should render an alert', () => {
const { queryByRole } = render(<Alert showAlert />);
expect(queryByRole('alert')).toBeDefined();
});
it('should not render an alert', () => {
const { queryByRole } = render(<Alert />);
const alert = queryByRole('alert');
expect(alert).toBeNull();
});
});