Generated with AI.
This guide describes a pattern for testing components that use React Suspense. Real-world Suspense boundaries resolve based on data fetches, lazy imports, or module loads. To test them deterministically we need to pause the suspended state, assert what the UI looks like while suspended, then resolve on demand and assert what it looks like after.
Do not let the suspended promise resolve on its own. Instead: