jargon

Comparison

Component testvsUser event simulation

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 →

User event simulation

the test typed into the field character by character instead of setting the value in one go.

Driving a test through the full sequence of events a real interaction produces — pointer down, focus, key down, input, key up — rather than dispatching a single synthetic event. It catches everything that depends on focus, on key handling, or on intermediate states, which a direct value assignment skips entirely. It is slower and it is what makes the test's passing mean something.

Full entry →

Related comparisons