score:0

  it('should call button onClick if being clicked', async () => {
    render(<UploadButton text="upload text" />);

    const spy = jest.spyOn(console, 'log');

    const button = screen.getByText('upload text');

    fireEvent.click(button);

    expect(spy).toBeCalled();
  });

Related Query

More Query from same tag