2016-10-10 22:44:06 +02: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 22:46:37 +02:00
|
|
|
describe('<Button />', () => {
|
|
|
|
it('simulates click events', () => {
|
2016-10-10 22:44:06 +02:00
|
|
|
const onClick = sinon.spy();
|
|
|
|
const wrapper = shallow(<Button onClick={onClick} />);
|
|
|
|
wrapper.find('button').simulate('click');
|
|
|
|
expect(onClick.calledOnce).to.equal(true);
|
|
|
|
});
|
|
|
|
});
|