@rocketsofawesome/mirage
Version:
[Live Demo of the Pattern Library](https://rocketsofawesome.github.io/mirage/)
42 lines (36 loc) • 976 B
JavaScript
import React from 'react'
import { css } from 'styled-components'
import 'jest-styled-components'
import { QuickAddSize } from 'SRC'
import { BaseQuickAddSizes } from './quickAddSizes.base'
import { productWithVariants } from '../defaultProps'
const { mountWithTheme } = global
const defaultProps = {
variants: [...productWithVariants.product.colorways[0].skus],
quickAdd: productWithVariants.quickAdd
}
describe('(Styled Component) QuickAddSizes', () => {
const createQuickAddSizes = (inProps) => {
const props = {
...defaultProps,
...inProps
}
return mountWithTheme(<BaseQuickAddSizes {...props} />)
}
test('matching the snapshot', () => {
expect(createQuickAddSizes())
.toMatchSnapshot()
})
test('renders the proper number of variants', () => {
expect(
createQuickAddSizes()
.find(QuickAddSize)
.length
).toEqual(
productWithVariants
.product
.skus
.length
)
})
})