title: @testing-library/react test form onSubmit
body: <p>In a simple scenario like so</p>
  
  <pre><code>function onSubmit() { e.preventDefault(); /* Some Submit Logic */ }
  
  &lt;form data-testid="form" onSubmit={(e) =&gt; onSubmit(e)}&gt;
     &lt;button type="submit" data-testid="submit-button"&gt;Submit&lt;/button&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>How do I make sure that the form gets submitted when the submit button is clicked?</p>
  
  <pre><code>const { queryByTestId } = render(&lt;LoginForm/&gt;);
  const LoginForm = queryByTestId("form")
  const SubmitButton = queryByTestId("submit-button")
  fireEvent.click(SubmitButton)
  
  ???
  </code></pre>
  
  <p>How do I test if onSubmit() has been called or maybe form has been submitted?</p>