You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
451 B

  1. import { expect } from 'chai';
  2. import { shallow } from 'enzyme';
  3. import sinon from 'sinon';
  4. import Button from '../../../app/assets/javascripts/components/components/button'
  5. describe('<Button />', function() {
  6. it('simulates click events', function() {
  7. const onClick = sinon.spy();
  8. const wrapper = shallow(<Button onClick={onClick} />);
  9. wrapper.find('button').simulate('click');
  10. expect(onClick.calledOnce).to.equal(true);
  11. });
  12. });