Skip to content

Commit 8849f74

Browse files
committed
2 parents dbead8b + 1833abc commit 8849f74

File tree

23 files changed

+61
-63
lines changed

23 files changed

+61
-63
lines changed

src/components/alpha/spec.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import React from 'react'
44
import renderer from 'react-test-renderer'
55
import { mount } from 'enzyme'
6-
import color, { red } from '../../helpers/color'
6+
import * as color from '../../helpers/color'
77
// import canvas from 'canvas'
88

99
import Alpha from './Alpha'
@@ -12,14 +12,14 @@ import AlphaPointer from './AlphaPointer'
1212

1313
test('Alpha renders correctly', () => {
1414
const tree = renderer.create(
15-
<Alpha { ...red } />,
15+
<Alpha { ...color.red } />,
1616
).toJSON()
1717
expect(tree).toMatchSnapshot()
1818
})
1919

2020
// test('Alpha renders on server correctly', () => {
2121
// const tree = renderer.create(
22-
// <Alpha renderers={{ canvas }} { ...red } />
22+
// <Alpha renderers={{ canvas }} { ...color.red } />
2323
// ).toJSON()
2424
// expect(tree).toMatchSnapshot()
2525
// })
@@ -29,7 +29,7 @@ test('Alpha onChange events correctly', () => {
2929
expect(color.simpleCheckForValidColor(data)).toBeTruthy()
3030
})
3131
const tree = mount(
32-
<Alpha { ...red } width={ 20 } height={ 200 } onChange={ changeSpy } />,
32+
<Alpha { ...color.red } width={ 20 } height={ 200 } onChange={ changeSpy } />,
3333
)
3434
expect(changeSpy).toHaveBeenCalledTimes(0)
3535
const alphaCommon = tree.find(CommonAlpha)
@@ -42,7 +42,7 @@ test('Alpha onChange events correctly', () => {
4242

4343
test('Alpha renders vertically', () => {
4444
const tree = renderer.create(
45-
<Alpha { ...red } width={ 20 } height={ 200 } direction="vertical" />,
45+
<Alpha { ...color.red } width={ 20 } height={ 200 } direction="vertical" />,
4646
).toJSON()
4747
expect(tree).toMatchSnapshot()
4848
})

src/components/block/Block.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from 'react'
22
import PropTypes from 'prop-types'
33
import reactCSS from 'reactcss'
44
import merge from 'lodash/merge'
5-
import color from '../../helpers/color'
5+
import * as color from '../../helpers/color'
66

77
import { ColorWrap, EditableInput, Checkboard } from '../common'
88
import BlockSwatches from './BlockSwatches'

src/components/block/spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { mount } from 'enzyme'
77
import Block from './Block'
88
import BlockSwatches from './BlockSwatches'
99
import { Swatch } from '../common'
10-
import color from '../../helpers/color'
10+
import* as color from '../../helpers/color'
1111

1212
test('Block renders correctly', () => {
1313
const tree = renderer.create(

src/components/chrome/ChromeFields.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import React from 'react'
44
import reactCSS from 'reactcss'
5-
import color from '../../helpers/color'
5+
import * as color from '../../helpers/color'
66
import isUndefined from 'lodash/isUndefined'
77

88
import { EditableInput } from '../common'

src/components/chrome/spec.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import React from 'react'
44
import renderer from 'react-test-renderer'
5-
import color, { red } from '../../helpers/color'
5+
import * as color from '../../helpers/color'
66
import { mount } from 'enzyme'
77

88
import Chrome from './Chrome'
@@ -14,7 +14,7 @@ import { Alpha } from '../common'
1414

1515
test('Chrome renders correctly', () => {
1616
const tree = renderer.create(
17-
<Chrome { ...red } />,
17+
<Chrome { ...color.red } />,
1818
).toJSON()
1919
expect(tree).toMatchSnapshot()
2020
})
@@ -24,7 +24,7 @@ test('Chrome onChange events correctly', () => {
2424
expect(color.simpleCheckForValidColor(data)).toBeTruthy()
2525
})
2626
const tree = mount(
27-
<Chrome { ...red } onChange={ changeSpy } />,
27+
<Chrome { ...color.red } onChange={ changeSpy } />,
2828
)
2929
expect(changeSpy).toHaveBeenCalledTimes(0)
3030

@@ -43,14 +43,14 @@ test('Chrome onChange events correctly', () => {
4343

4444
// test('Chrome renders on server correctly', () => {
4545
// const tree = renderer.create(
46-
// <Chrome renderers={{ canvas }} { ...red } />
46+
// <Chrome renderers={{ canvas }} { ...color.red } />
4747
// ).toJSON()
4848
// expect(tree).toMatchSnapshot()
4949
// })
5050

5151
test('ChromeFields renders correctly', () => {
5252
const tree = renderer.create(
53-
<ChromeFields { ...red } />,
53+
<ChromeFields { ...color.red } />,
5454
).toJSON()
5555
expect(tree).toMatchSnapshot()
5656
})
@@ -81,4 +81,4 @@ test('Chrome renders correctly with width', () => {
8181
<Chrome width={300} />,
8282
).toJSON()
8383
expect(tree.props.style.width).toBe(300)
84-
});
84+
});

src/components/circle/spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { mount } from 'enzyme'
77
import Circle from './Circle'
88
import CircleSwatch from './CircleSwatch'
99
import { Swatch } from '../common'
10-
import color from '../../helpers/color'
10+
import * as color from '../../helpers/color'
1111

1212
test('Circle renders correctly', () => {
1313
const tree = renderer.create(

src/components/common/ColorWrap.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { Component, PureComponent } from 'react'
22
import debounce from 'lodash/debounce'
3-
import color from '../../helpers/color'
3+
import * as color from '../../helpers/color'
44

55
export const ColorWrap = (Picker) => {
66
class ColorPicker extends (PureComponent || Component) {

src/components/compact/Compact.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types'
33
import reactCSS from 'reactcss'
44
import map from 'lodash/map'
55
import merge from 'lodash/merge'
6-
import color from '../../helpers/color'
6+
import * as color from '../../helpers/color'
77

88
import { ColorWrap, Raised } from '../common'
99
import CompactColor from './CompactColor'

src/components/compact/CompactColor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react'
22
import reactCSS from 'reactcss'
3-
import colorUtils from '../../helpers/color'
3+
import * as colorUtils from '../../helpers/color'
44

55
import { Swatch } from '../common'
66

src/components/compact/spec.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import React from 'react'
44
import renderer from 'react-test-renderer'
55
import { mount } from 'enzyme'
6-
import color, { red } from '../../helpers/color'
6+
import * as color from '../../helpers/color'
77

88
import Compact from './Compact'
99
import CompactColor from './CompactColor'
@@ -12,14 +12,14 @@ import { Swatch } from '../common'
1212

1313
test('Compact renders correctly', () => {
1414
const tree = renderer.create(
15-
<Compact { ...red } />,
15+
<Compact { ...color.red } />,
1616
).toJSON()
1717
expect(tree).toMatchSnapshot()
1818
})
1919

2020
test('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

6262
test('CompactFields renders correctly', () => {
6363
const tree = renderer.create(
64-
<CompactFields { ...red } />,
64+
<CompactFields { ...color.red } />,
6565
).toJSON()
6666
expect(tree).toMatchSnapshot()
6767
})
6868

6969
test('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

Comments
 (0)