Skip to the editor

Assert the cart badge updates

State across pages · level 1 of 5 · Terra Supply

The assertion is the test. Everything before it is only setup.

The problem

The test adds a product to the cart. It does the action, but it proves nothing yet.

Add the one assertion that shows the cart badge went from empty to 1. Where the // TODO is.

Fill in the missing assertion

The test is set up but proves nothing yet. Add the assertion where the TODO is.

Done when

  • After adding a product, the cart badge reads 1.

Bugs we plant

  • Cart badge always shows 0

We break each one in a copy of the app. Your assertion has to fail on every copy.

Loading the editor…