Search⌘ K
AI Features

Unknown Actions

Understand how to test Redux reducers so they return the exact original state when an unknown action is dispatched. This lesson covers why using .toBe() is critical for verifying state integrity and preventing unintended state changes in your application.

We'll cover the following...

One last issue to test with reducers is that they gracefully handle unknown actions and return the original state passed to them without modifications.

Since every action can propagate to the whole reducer tree, the reducer needs to return the original state ...