import * as fc from 'fast-check' import * as Enzyme from 'enzyme' import * as Axe from 'jest-axe' import * as React from 'react' import Button, { Variant } from './Button' import stringify from '../../services/stringify' const CUSTOM_VARIANTS: string[] = ['primary'] const AVAILABLE_VARIANTS: string[] = ['outline', 'primary'] const BLOCK_DISPLAYS = ['block', 'grid', 'flex', 'table'] it('should exist', () => { expect(Button).toBeDefined() }) it('should be a component', () => { expect(Button).toBeComponent() }) it('should render without crashing given minimum required props', () => { expect(() => ) expect(wrapper).toHaveText(stringify(label)) }), { numRuns: 300, }, ) }) describe.each(AVAILABLE_VARIANTS)('with %p variant', (rawVariant) => { const variant = rawVariant as Variant it('should render background color', () => { const wrapper = Enzyme.shallow() const results = await Axe.axe(wrapper.getDOMNode()) expect(results).toHaveNoViolations() }), ) })