# Component testing vs end-to-end testing

> Compare isolated component checks and full checkout journeys. Choose a test for input validation, routing or a missing order in the database.

Source: https://cueapril.com/compare/component-vs-end-to-end-testing
Updated: 2026-12-01
Index: https://cueapril.com/llms.txt

## How much of the application must run to detect this checkout failure?

Use a component test when the failure is observable by rendering one component with controlled inputs. Use an end-to-end test when navigation, session state or a real persistence boundary is part of the requirement. Keep a small number of cross-application journeys and test variations close to the component that owns them.

Compare isolated component checks and end-to-end journeys for checkout. Decide how much of the application must run to reveal a lost address.

Cue April editorial assessment. The sources identify documented capabilities. Suggested pilot checks are evaluation criteria.

## Split an address error from a lost address

Mount a checkout address form with a missing postcode. Exercise its validation and assert the field label, error and retained text. To investigate an address that disappears after confirmation, open checkout on a disposable account, save the address, navigate away and reopen the order. A component with a mocked success callback cannot prove that persistence.

Component tests vs. end-to-end tests

| Checkout risk | Component-level check | End-to-end check |
| --- | --- | --- |
| Required field is unexplained | Render the form and inspect its error. | Keep one representative failed submission in context. |
| Save callback has the wrong payload | Assert its arguments at the component boundary. | Inspect the eventual stored address. |
| Confirmation route loses the order ID | A stubbed router can verify intended navigation. | Navigate to the real route and load the order. |
| One hundred postcode examples | Exercise them cheaply at the owning boundary. | Reserve full journeys for meaningful differences. |

## Give the component a realistic contract

Use a maintained fixture for the address shape and include a rejected submission. Assert what a person can see or what the component sends at its boundary. In the cross-application case, wait for the saved order to become available and assert the new address on a fresh load. These checks answer different questions even if both use a browser.

## Primary documentation

- [Cypress component testing](https://docs.cypress.io/app/component-testing/get-started)
- [Ham Vocke on the practical test pyramid](https://martinfowler.com/articles/practical-test-pyramid.html)

By Cue April. Updated 2026-12-01.

## Related

- [Testing comparisons](https://cueapril.com/compare): Compare testing tools and methods against a release decision. Inspect the required evidence, maintenance work and checks each approach can provide.
- [Playwright testing](https://cueapril.com/testing/playwright-testing): An AI testing agent runs your approved Playwright tests and keeps the results, source identity and gaps. Review accessibility scans alongside journeys.
- [Unit testing](https://cueapril.com/testing/unit-testing): Unit testing explained, with examples. Run your Jest or Vitest suites against a pinned code revision and inspect the native results and remaining gaps.
