33import React from 'react'
44import renderer from 'react-test-renderer'
55import { mount } from 'enzyme'
6- import color , { red } from '../../helpers/color'
6+ import * as color from '../../helpers/color'
77
88import Compact from './Compact'
99import CompactColor from './CompactColor'
@@ -12,14 +12,14 @@ import { Swatch } from '../common'
1212
1313test ( 'Compact renders correctly' , ( ) => {
1414 const tree = renderer . create (
15- < Compact { ...red } /> ,
15+ < Compact { ...color . red } /> ,
1616 ) . toJSON ( )
1717 expect ( tree ) . toMatchSnapshot ( )
1818} )
1919
2020test ( 'Compact with onSwatchHover renders correctly' , ( ) => {
2121 const tree = renderer . create (
22- < Compact { ...red } onSwatchHover = { ( ) => { } } /> ,
22+ < Compact { ...color . red } onSwatchHover = { ( ) => { } } /> ,
2323 ) . toJSON ( )
2424 expect ( tree ) . toMatchSnapshot ( )
2525} )
@@ -29,7 +29,7 @@ test('Compact onChange events correctly', () => {
2929 expect ( color . simpleCheckForValidColor ( data ) ) . toBeTruthy ( )
3030 } )
3131 const tree = mount (
32- < Compact { ...red } onChange = { changeSpy } /> ,
32+ < Compact { ...color . red } onChange = { changeSpy } /> ,
3333 )
3434 expect ( changeSpy ) . toHaveBeenCalledTimes ( 0 )
3535 const swatches = tree . find ( Swatch )
@@ -43,7 +43,7 @@ test('Compact with onSwatchHover events correctly', () => {
4343 expect ( color . simpleCheckForValidColor ( data ) ) . toBeTruthy ( )
4444 } )
4545 const tree = mount (
46- < Compact { ...red } onSwatchHover = { hoverSpy } /> ,
46+ < Compact { ...color . red } onSwatchHover = { hoverSpy } /> ,
4747 )
4848 expect ( hoverSpy ) . toHaveBeenCalledTimes ( 0 )
4949 const swatches = tree . find ( Swatch )
@@ -61,14 +61,14 @@ test('CompactColor renders correctly', () => {
6161
6262test ( 'CompactFields renders correctly' , ( ) => {
6363 const tree = renderer . create (
64- < CompactFields { ...red } /> ,
64+ < CompactFields { ...color . red } /> ,
6565 ) . toJSON ( )
6666 expect ( tree ) . toMatchSnapshot ( )
6767} )
6868
6969test ( 'Compact renders custom styles correctly' , ( ) => {
7070 const tree = renderer . create (
71- < Compact { ...red } styles = { { default : { wrap : { boxShadow : '0 0 10px red' } } } } /> ,
71+ < Compact { ...color . red } styles = { { default : { wrap : { boxShadow : '0 0 10px red' } } } } /> ,
7272 ) . toJSON ( )
7373 expect ( tree . props . style . boxShadow ) . toBe ( '0 0 10px red' )
7474} )
0 commit comments