1
0
puyopuyotetr.is/spec/javascript/components/button.test.jsx

15 lines
441 B
React
Raw Normal View History

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