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.
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.
| 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.