1 | import React from 'react'
|
2 | import { css } from 'styled-components'
|
3 | import 'jest-styled-components'
|
4 |
|
5 | import { Guarantee } from 'SRC'
|
6 | import { UnstyledGuarantee } from './guarantee'
|
7 |
|
8 | const { mountWithTheme } = global
|
9 |
|
10 | describe('(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 |
|
21 | describe('(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 | })
|