Testing comparisons

Component tests vs. end-to-end tests

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

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.

Component tests vs. end-to-end tests
Checkout riskComponent-level checkEnd-to-end check
Required field is unexplainedRender the form and inspect its error.Keep one representative failed submission in context.
Save callback has the wrong payloadAssert its arguments at the component boundary.Inspect the eventual stored address.
Confirmation route loses the order IDA stubbed router can verify intended navigation.Navigate to the real route and load the order.
One hundred postcode examplesExercise 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

Your next release starts here

Keep building.
Put testing to work.

Give Cue April your next testing challenge. Let your AI quality lead coordinate the checks, so your team can focus on what comes next.

Create account

Create your account, connect a repository and review your proposed setup before approving a run.