UNPKG

@retailmenot/anchor

Version:

A React UI Library by RetailMeNot

29 lines 1.21 kB
// VENDOR import * as React from 'react'; import * as renderer from 'react-test-renderer'; import { ThemeProvider } from '@xstyled/styled-components'; // ANCHOR import { RootTheme } from '../../theme/index'; // COMPONENT import { Checkbox } from './Checkbox.component'; describe('Component: Checkbox', () => { it('should be defined', () => { const subject = (React.createElement(ThemeProvider, { theme: RootTheme }, React.createElement(Checkbox, null))); const tree = renderer.create(subject).toJSON(); expect(tree).toMatchSnapshot(); }); it('should be disableable', () => { const subject = (React.createElement(ThemeProvider, { theme: RootTheme }, React.createElement(Checkbox, { disabled: true }))); const tree = renderer.create(subject).toJSON(); expect(tree).toMatchSnapshot(); }); it('can be checked', () => { const subject = (React.createElement(ThemeProvider, { theme: RootTheme }, React.createElement(Checkbox, { checked: true }))); const tree = renderer.create(subject).toJSON(); expect(tree).toMatchSnapshot(); }); }); //# sourceMappingURL=Checkbox.component.spec.js.map