Testing·Intermediate·Conceptual·1 min read
What should a React component test primarily assert on?
Short interview answer
It should assert on what a user can observe — rendered text, roles, visible state, navigation, and side effects like a request being made — rather than on internal component state, hook values, or how many times a prop callback fired. That keeps the test meaningful and resilient to refactoring.
Key takeaway
Explain the underlying mental model clearly, then support it with a concrete example and its trade-offs.