2016-10-10 13:44:06 -07:00
|
|
|
import { expect } from 'chai';
|
|
|
|
import { shallow } from 'enzyme';
|
|
|
|
import sinon from 'sinon';
|
|
|
|
|
|
|
|
import Button from '../../../app/assets/javascripts/components/components/button'
|
|
|
|
|
2016-10-10 13:46:37 -07:00
|
|
|
describe('<Button />', () => {
|
|
|
|
it('simulates click events', () => {
|
2016-10-10 13:44:06 -07:00
|
|
|
const onClick = sinon.spy();
|
|
|
|
const wrapper = shallow(<Button onClick={onClick} />);
|
|
|
|
wrapper.find('button').simulate('click');
|
|
|
|
expect(onClick.calledOnce).to.equal(true);
|
|
|
|
});
|
|
|
|
});
|