📅  最后修改于: 2022-03-11 15:01:46.140000             🧑  作者: Mango
import React from 'react';
import { shallow } from 'enzyme';
import Button from './Button';
describe('Test Button component', () => {
it('Test click event', () => {
const mockCallBack = jest.fn();
const button = shallow(());
button.find('button').simulate('click');
expect(mockCallBack.mock.calls.length).toEqual(1);
});
});