title: React-testing-library mock function not called
body: <p>i'm trying to test my component: </p>
  
  <p>in my componet when i click to button i call some function and pass there some id.</p>
  
  <p>my test:</p>
  
  <pre><code>it("should call function on submit click", async () =&gt; {
    const wrapper = render(&lt;Component /&gt;);
     const id = "1";
    const handleSubmit = jest.fn();
    const SubmitBtn = wrapper.getByTestId("submit-btn");
    fireEvent.click(SubmitBtn);
    await waitFor(() =&gt; wrapper);
    expect(handleSubmit).toHaveBeenCalled();
  });
  </code></pre>
  
  <p>here i tried:</p>
  
  <pre><code>expect(handleSubmit).toHaveBeenCalled();
  expect(handleSubmit).toHaveBeenCalledWith(id);
  expect(handleSubmit).toBeCalled();
  expect(handleSubmit).toBeCalledWith(id)
  </code></pre>
  
  <p>tried everything but it's not works..</p>
  
  <pre><code> expect(jest.fn()).toBeCalled()
      Expected number of calls: &gt;= 1
      Received number of calls:    0
  </code></pre>