What integration tests cover
An integration test exercises multiple components together plus their shared state and data layer, but still runs in a simulated DOM with mocked network. It checks that the pieces wire up correctly.
Why they earn their keep
- Most real bugs live in the seams between units, not inside a single function.
- They give high confidence per test because they cover a meaningful flow.
- They stay fast since the browser and backend are still faked.
A typical flow
- Render a feature such as a search page with its real child components.
- Type a query, submit, and let a mocked API return results.
- Assert that the list renders and an empty state shows when no results return.
Balancing the pyramid
- Many cheap unit tests for tricky logic.
- A solid middle layer of integration tests for flows.
- A few slow end to end tests for the riskiest paths.
Integration tests are often the sweet spot of confidence per second of runtime.
Key idea
Integration tests exercise components together through a flow, catching the seam bugs unit tests miss.