scratch-paint/test/unit/components/line-mode.test.jsx

16 lines
575 B
React
Raw Normal View History

2017-08-25 10:45:22 -04:00
/* eslint-env jest */
import React from 'react'; // eslint-disable-line no-unused-vars
import {shallow} from 'enzyme';
import LineModeComponent from '../../../src/components/line-mode.jsx'; // eslint-disable-line no-unused-vars
describe('LineModeComponent', () => {
test('triggers callback when clicked', () => {
const onClick = jest.fn();
const componentShallowWrapper = shallow(
<LineModeComponent onMouseDown={onClick}/>
);
componentShallowWrapper.simulate('click');
expect(onClick).toHaveBeenCalled();
});
});