UNPKG

1.05 kBJavaScriptView Raw
1import React from 'react'
2import 'jest-styled-components'
3import { H1, H2, Label, OutfitsListing } from 'SRC'
4
5const { mountWithTheme } = global
6
7const defaultProps = {
8 headerContent: [
9 <H1 key='header'>Header 1</H1>,
10 <H2 key='subheader'>Header 2</H2>
11 ],
12 outfits: [
13 {
14 image: {
15 src: 'https://d2lknnt52h7uhg.cloudfront.net/roa-canon/image/upload/t_plp_product_shot/v1/production/catalog/m44tim52vvuz4ofsb5te.jpg'
16 },
17 information: [
18 <Label key='title'>Lacey & Lively</Label>,
19 <Label key='price'>$50.00</Label>
20 ]
21 }
22 ]
23}
24
25describe('(Template) OutfitsListing', () => {
26 const createOutfitsListing = (inProps) => {
27 const props = {
28 ...defaultProps,
29 ...inProps
30 }
31 return mountWithTheme(<OutfitsListing {...props} />)
32 }
33 test('matching the snapshot', () => {
34 expect(createOutfitsListing())
35 .toMatchSnapshot()
36 })
37
38 test('renders our header if headerContent prop is passed', () => {
39 expect(createOutfitsListing().find('header').length).toEqual(1)
40 })
41})
42
\No newline at end of file