UNPKG

1.09 kBJavaScriptView Raw
1import React from 'react'
2import { css } from 'styled-components'
3import 'jest-styled-components'
4
5import { Guarantee } from 'SRC'
6import { UnstyledGuarantee } from './guarantee'
7
8const { mountWithTheme } = global
9
10describe('(Styled Component) Guarantee', () => {
11 const createGuarantee = (props) => {
12 return mountWithTheme(<Guarantee {...props} />)
13 }
14
15 test('matching the snapshot', () => {
16 expect(createGuarantee())
17 .toMatchSnapshot()
18 })
19})
20
21describe('(Component) UnstyledGuarantee', () => {
22 const createUnstyledGuarantee = (props) => {
23 return mountWithTheme(<UnstyledGuarantee {...props} />)
24 }
25
26 test('mathing the snapsot', () => {
27 expect(createUnstyledGuarantee())
28 .toMatchSnapshot()
29 })
30
31 test('setting the class', () => {
32 const className = 'example-class'
33 expect(
34 createUnstyledGuarantee({className: className}).prop('className')
35 ).toEqual(className)
36 })
37
38 test('settting the chirldren', () => {
39 const child = 'Example Text'
40 expect(
41 createUnstyledGuarantee({children: child}).text()
42 ).toContain(child)
43 })
44})