1import React from 'react';
2import { shallow } from 'enzyme';
3import Button from './Button';
4
5describe('Test Button component', () => {
6 it('Test click event', () => {
7 const mockCallBack = jest.fn();
8
9 const button = shallow((<Button onClick={mockCallBack}>Ok!</Button>));
10 button.find('button').simulate('click');
11 expect(mockCallBack.mock.calls.length).toEqual(1);
12 });
13});
14