title: How do I test an async handler in @testing-library/react-native?
body: <p>I can not wrap my head around this but it's probably a simple one.</p>
  <p>Let's say I have this:</p>
  <pre><code>   &lt;MyComponent amazingAction={action}/&gt;
     &lt;MagicButton/&gt;
  </code></pre>
  <p>So it's essentially a component with a handle and another component that when clicked will do an async action. Because of that async action, the handler in <em>MyComponent</em> will be triggered.</p>
  <p>I essentially want to test that if I render both and trigger a click on the button, the handler will be called.</p>
  <p>I tried this:</p>
  <pre><code>const maybeThisWorks = jest.fn();
  
  const { getByText } = render(
        &lt;MyComponent amazingAction={maybeThisWorks}/&gt;
        &lt;MagicButton title=&quot;My Button&quot;/&gt;
  );
  
  let button = getByText(&quot;My Button&quot;);
  fireEvent.press(button);
  
  expect(maybeThisWorks).toHaveBeenCalled();
  
  </code></pre>