- 
                Notifications
    You must be signed in to change notification settings 
- Fork 1.1k
Description
- @testing-library/reactversion: 13.4.0
- Testing Framework and version: jest@27.5.1
- DOM Environment: jsdom@16.7.0
- node: 16.14.2
- react: 18.2.0
Relevant code or config:
  render(<App />);
  
  //generates an unexpected act warning after upgrading
  await screen.findByText('Loading...')
  const text = await screen.findByText('testing123');
  expect(text).toBeInTheDocument();What you did:
Upgraded existing application to react 18+ and RTL 13+.
What happened:
A number of tests starting producing act warnings after the upgrade.
In this case, the component being rendered has initial "loading" state before a fetch is completed and the state is changed.  Our existing tests awaited the "loading" text.  This now produces an act warning.
Reproduction:
I was able to reproduce the issue with a simple CRA repo, here: https://github.com/trv-wcaneira/act-warning-mcve
Problem description:
The act warning is certainly a distraction over hundreds of tests, but concerning because I know it is there for a reason, and I'd like to understand what is wrong.
Suggested solution:
I can replace the await findBy* queries in our tests for this use case, but I'd like to better understand why this is happening (please).  I am especially curious because after upgrading, I have noticed a number of behavior changes in existing tests (that I'll file separate issues for).