mirror of
https://github.com/lunaisnotaboy/mastodon.git
synced 2024-11-06 06:56:22 +00:00
15 lines
451 B
React
15 lines
451 B
React
|
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);
|
||
|
});
|
||
|
});
|