title: How to wait until button's disabled state is changed in testing library?
body: <p>I have a React component with a input field and a button disabled at the very beginning. This button's state ( disabled ) changes if input provided by user to input field is validated by API, which is called after anything is typed in input field.</p>
  <p>I am testing by providing a valid input but it needs to wait until API's call is completed, so basically i want to test, if on providing a valid input, button get re enabled or not in my test.</p>
  <p>I am doing this by following code:</p>
  <pre><code>userEvent.type(getByRole(&quot;textbox&quot;), &quot;HELLO&quot;);
  await waitFor(() =&gt; expect(getByTestId(&quot;my-btn&quot;)).not.toBeDisabled());
  
  </code></pre>
  <p>But its not working even with a valid input</p>