Skip to content
Testing·Intermediate·Conceptual·1 min read

What should frontend component tests assert?

Short interview answer

Assert behavior users can observe—roles, names, text, state, navigation, and side effects—rather than private component instances or implementation calls. This makes tests resilient to refactoring while still catching broken contracts.

Key takeaway

Explain the underlying mental model clearly, then support it with a concrete example and its trade-offs.

← Back to Testing strategy

Related questions