UNPKG

756 BJavaScriptView Raw
1import React from 'react'
2import { css } from 'styled-components'
3import 'jest-styled-components'
4
5import { theme } from 'SRC/core/theme'
6import Color, { colors } from './colors'
7
8const { shallowWithTheme } = global
9
10describe('(Styled Component) Color', () => {
11 const createColor = (props) => {
12 return shallowWithTheme(<Color {...props} />)
13 }
14
15 test('matching the snapshot', () => {
16 expect(createColor())
17 .toMatchSnapshot()
18 })
19
20 test('Setting the color', () => {
21 expect(createColor({color: theme.colors.rocketBlue}))
22 .toHaveStyleRule({
23 'background-color': theme.colors.rocketBlue
24 })
25 })
26})
27
28describe('(Object) colors', () => {
29 test('matching the snapshot', () => {
30 expect(colors)
31 .toMatchSnapshot()
32 })
33})
34
\No newline at end of file