@rocketsofawesome/mirage
Version:
[Live Demo of the Pattern Library](https://rocketsofawesome.github.io/mirage/)
47 lines (38 loc) • 1.03 kB
JavaScript
import React from 'react'
import { css } from 'styled-components'
import 'jest-styled-components'
import { BagIcon } from 'SRC'
import { BaseBagIcon } from './BagIcon'
const { shallowWithTheme } = global
describe('(Styled Component) BagIcon', () => {
const createBagIcon = (props) => {
return shallowWithTheme(<BagIcon {...props} />)
}
test('matching the snapshot', () => {
expect(createBagIcon())
.toMatchSnapshot()
})
test('setting the width', () => {
const width = '6rem'
expect(createBagIcon({width: width}))
.toHaveStyleRule({
width: width
})
})
})
describe('(Component) BaseBagIcon', () => {
const createBaseBagIcon = (props) => {
return shallowWithTheme(<BaseBagIcon {...props} />)
}
test('matching the snapshot', () => {
expect(createBaseBagIcon())
.toMatchSnapshot()
})
test('setting the count', () => {
const count = 4
expect(
createBaseBagIcon({count: count})
.find('text').last().text()
).toEqual(count.toString())
})
})