This repository has been archived on 2019-05-14. You can view files and clone it, but cannot push or open issues or pull requests.
mastodon/spec/javascript/components/button.test.jsx

15 lines
451 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'
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);
});
});