UNPKG

react-color

Version:

A Collection of Color Pickers from Sketch, Photoshop, Chrome & more

25 lines (17 loc) 570 B
'use strict'; import { React, TestUtils, expect, chai, spies, defaultProps } from '../config'; const SketchComponent = require('../../src/components/sketch-2/Sketch'); let props; describe('Sketch', () => { beforeEach(() => { props = defaultProps; }); it('should pass up data onChange', () => { props.onChange = chai.spy((data) => { expect(data).to.equal('#333'); }); const Sketch = TestUtils.renderIntoDocument(<SketchComponent {...props} />); Sketch.handleChange('#333'); expect(props.onChange).to.have.been.called; }); });