Loading lesson…
Level 1 · Apprentice0 XP
Test what the user sees and does, not how the component is built.
Step 1 / 5
ProblemA test checks that a component's internal state equals 3 and that a private function was called. You rename a variable and twenty tests fail, although the screen works exactly as before.
← → step
Before this: Next.js App Router
🛠️ Your turn
Reading is not the skill, doing is. Try for ten minutes before you open the hint. Getting stuck first is what makes the solution stick.
1.Write two tests for a to-do component: adding a task shows it in the list, and ticking it marks it as done. Find every element by role or label, never by class name. Then refactor the component's internals and confirm the tests still pass.