title: @testing-library/React : Clicking outside of component not working
body: <p>I'm using react testing library to test my component built with FluentUI.</p>
  <p>Here is link:
  <a href="https://codesandbox.io/s/keen-borg-2tqmj?file=/src/App.spec.js" rel="nofollow noreferrer">https://codesandbox.io/s/keen-borg-2tqmj?file=/src/App.spec.js</a></p>
  <p>The code is basically a pasted snippet of the example code of <code>Dialog</code> component from FluentUI docs site. The behavior that I'm testing is:</p>
  <ol>
  <li>User opens the dialog</li>
  <li>User clicks outside of the dialog</li>
  <li><code>onDimiss</code> prop of the component should be fired.</li>
  </ol>
  <p>It works when I'm playing with it manually however it seems that I failed to simulate a click outside of the component with testing library.</p>
  <p>I tried using <code>userEvent.click(document.body)</code> as mentioned in <a href="https://stackoverflow.com/questions/56978283/unit-testing-react-click-outside-component-using-jest-and-react-testing-library">this post</a> but got no luck</p>
  <p>Does anyone has any idea how to make test work?</p>