Comparison
Component testvsIntegration test
Component test
you rendered the component, clicked the button as a user would, and asserted on what appeared.
A test that renders a component with its real children and asserts on the rendered output and behaviour rather than on internals. It is the highest-value shape in frontend testing, because it catches the wiring mistakes that unit tests structurally cannot while still running fast. It stays useful across refactors only if it queries by role and text, the way a user finds things.
Full entry →Integration test
you tested several components and the data layer together, with the network stubbed out.
A test covering a group of units working together — a form, its validation, and the request it makes — with the boundaries of the system faked. It catches contract mismatches between pieces, which is where most real bugs live. The boundary between this and a component test is fuzzy and arguing about it is rarely worth the time; the boundary that matters is whether a real browser and a real server are involved.
Full entry →