UNPKG

@rocketsofawesome/mirage

Version:

[Live Demo of the Pattern Library](https://rocketsofawesome.github.io/mirage/)

30 lines (24 loc) 749 B
import React from 'react' import { shallow } from 'enzyme' import { css } from 'styled-components' import 'jest-styled-components' import { theme } from 'SRC/core/theme' import StyledCheck, { checked } from './Check.base' const { shallowWithTheme } = global describe('(Base Component) Check', () => { const createBaseCheck = (props) => { return shallowWithTheme( <StyledCheck {...props}/> ) } test('matching the snapshot', () => { const component = createBaseCheck() expect(component).toMatchSnapshot() }) test('adding "checked" styles when checked is passes', () => { const component = createBaseCheck({checked: true}) expect(component).toHaveStyleRule({ modifier: css`${checked}`, }) }) })