nexxtway/react-rainbow

View on GitHub
src/components/Drawer/__test__/drawer.a11y.spec.js

Summary

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

describe('<Drawer/>', () => {
    it('should be accessible', async () => {
        expect.assertions(1);
        const wrapper = mount(
            <Drawer isOpen header="Drawer a11y" footer={<Button label="button in drawer footer" />}>
                <p>A rainbow is a meteorological phenomenon ...</p>
            </Drawer>,
        );

        const html = wrapper.html();
        const results = await axe(html);
        expect(results).toHaveNoViolations();
    });
});