📅  最后修改于: 2022-03-11 14:59:52.945000             🧑  作者: Mango
it('calls "onClick" prop on button click', () => {
// Render new instance in every test to prevent leaking state
const onClick = jest.fn();
const { getByText } = render();
fireEvent.click(getByText(/click me nao/i));
expect(onClick).toHaveBeenCalled();
});