nexxtway/react-rainbow

View on GitHub
src/components/Modal/__test__/modal.a11y.spec.js

Summary

Maintainability
B
5 hrs
Test Coverage
import React from 'react';
import { mount } from 'enzyme';
import axe from '../../../../axe';
import Modal from '..';
import Button from '../../Button';

describe('<Modal/>', () => {
    it('should be accessible', async () => {
        expect.assertions(1);
        const wrapper = mount(
            <Modal isOpen title="Modal a11y" footer={<Button label="button in modal footer" />}>
                <p>A rainbow is a meteorological phenomenon ...</p>
            </Modal>,
        );
        const html = wrapper.html();
        const results = await axe(html);
        expect(results).toHaveNoViolations();
    });
});