about summary refs log tree commit diff
path: root/spec/javascript/components/button.test.jsx
blob: 5610e67dd2e9ce71a62b6e935cc47c9428d8fb1f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import { expect } from 'chai';
import { shallow } from 'enzyme';
import sinon from 'sinon';

import Button from '../../../app/assets/javascripts/components/components/button'

describe('<Button />', function() {
  it('simulates click events', function() {
    const onClick = sinon.spy();
    const wrapper = shallow(<Button onClick={onClick} />);
    wrapper.find('button').simulate('click');
    expect(onClick.calledOnce).to.equal(true);
  });
});