import * as React from 'react'; import { shallow } from 'enzyme'; import IconCheckbox from './IconCheckbox'; import YellowStar from '../../../svg/star--yellow.svg'; import TestComponentPropUtils from '../../../utils/TestComponentPropUtils'; describe('Checkbox', () => { it('renders without crashing', () => { shallow( null} Icon={YellowStar} />); }); it('renders basic react props like id, className, and style as element attributes', () => { const shallowWrapper = shallow( null} Icon={YellowStar} {...TestComponentPropUtils.basicReactProps} />); expect(shallowWrapper.props().style.cursor).toBe('pointer'); expect(shallowWrapper.props().className).toContain('myClass'); }); it('renders name attribute correctly', () => { const component = shallow( null} Icon={YellowStar} />); expect(component.exists('[name="FormName"]')).toBe(true); }); });