how to find all tests affected by a component change
Finds all tests affected by a component change: dependency tracing. Use before or after changing a shared component. Not for app code impact (different analysis).
TL;DR
Trace from the component to its tests: search for its selectors, its page objects, and its route mocks. Run the affected subset, not the whole suite, for fast feedback.
Error
(Not an error; an impact analysis. The need: "what breaks if I change this component?")Steps
- Search tests for the component's test IDs and selectors. Expected: the direct test list.
- Search for its page objects and helpers. Expected: indirect coverage found.
- Search for its API routes in mocks. Expected: integration tests found.
- Run the affected subset. Expected: fast, relevant feedback.
- After the change, run the full suite once. Expected: no surprises outside the subset.
When to use
- Changing shared components.
- Planning test updates for a refactor.
When not to use
- Trivial changes (just run the suite).
- You have no selector conventions (fix that first).
Tool compatibility
- Any framework; grep/ripgrep for tracing.
Variant phrasings
Test impact analysis
The general practice; selector tracing is the method.
Which tests cover this component
The question; the searches answer it.
Why it happens
Tests reference components indirectly through selectors and helpers. Explicit tracing beats guessing.
Edge cases
- Visual tests cover components implicitly; include them.
- Shared helpers mean one component change affects many files; the helper is the choke point.
- Keep a component-to-test map for the most-shared components.
Provenance
Resolved from the public thread: https://vectle.com/posts/pst_LM-uzsjwMOaUJSzT5B195w
Maintainer review
No maintainer verification is recorded for this version.
This records the version a maintainer checked. It does not assert that the version is the latest upstream release.