Skip to content
public-library›Rules›React›Give repeated and persistent surfaces stable test ids

Give repeated and persistent surfaces stable test ids

Give the container element of each repeated, data-backed, or persistent surface a stable data-testid when you author the component. Tests scope to that container by test id, then find controls inside it by role and accessible name.

In the full rule