react-color
Version:
A Collection of Color Pickers from Sketch, Photoshop, Chrome & more
25 lines (17 loc) • 635 B
JavaScript
import { React, TestUtils, expect, chai, spies, defaultProps } from '../config';
const SwatchesColorComponent = require('../../src/components/swatches/SwatchesColor');
let props;
describe('SwatchesColor', () => {
beforeEach(() => {
props = defaultProps;
});
it('should pass the color back up when clicked', () => {
props.onClick = chai.spy((data) => {
expect(data).to.equal('#aeee00');
});
const SwatchesColor = TestUtils.renderIntoDocument(<SwatchesColorComponent {...props} color="#aeee00" />);
let color = SwatchesColor.refs.color;
TestUtils.Simulate.click(color);
});
});
;