about summary refs log tree commit diff
path: root/spec/javascript/components/button.test.jsx
blob: 0f16ebe8ed55f9ae2cbe1722501add41392a4659 (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 />', () => {
  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);
  });
});