In React 18 it was possible to render a component that suspended and assert against both the Suspense
fallback and its children once ready, like this:
render(
<Suspense fallback="fallback">
<TestComponent />
</Suspense>
);
expect(screen.getByText("fallback")).toBeInTheDocument();
expect(await screen.findByText("resolved")).toBeInTheDocument();
In React 19 the same test would be stuck on the fallback. Wrapping the render in an awaited act (as suggested by the warning emitted by RTL) makes assertions against the fallback impossible as act returns after Suspense
renders its children.