SpinTheMic
Pro

Interview practice question

Writing a first test for a counter component

Frontend Engineering · Testing and Tooling · Beginner

How would you test a simple counter component with increment and decrement buttons?

What a strong answer covers

Your AI report card counts how many of these ideas you cover.

  • Render component.
  • Find buttons by role/name.
  • Simulate clicks with user-event.
  • Assert displayed count.
  • Test edge cases (min value).
Practise this topic

Start without signing up. Sign in free to get an AI report card on your answer.

See all topics