title: React Testing Library: When to use userEvent.click and when to use fireEvent
body: <p>I'm presently learning React-Testing-Library.</p>
  <p>I'd like to test mouse interaction with an element. Presently it's a bit unclear to me the difference between userEvent.click(element) and fireEvent.click(element). Are both recommended for use, and in the example below are they being correctly implemented?</p>
  <pre><code>const mockFunction = jest.fn(() =&gt; console.info('button clicked'));
  const { getByTestId } = render(&lt;MyAwesomeButton onClick={mockFunction} /&gt;);
  const myAwesomeButton = getByTestId('my-awesome-button');
  
  // Solution A
  fireEvent(myAwesomeButton)
  expect(mockFunction.toHaveBeenCalledTimes(1);
  
  // Solution B
  userEvent.click(myAwesomeButton);
  expect(mockFunction).toHaveBeenCalledTimes(1);
  </code></pre>
  <p>Thanks in advance for any clarity.</p>