This story on HackerNoon has a decentralized backup on Sia.
Transaction ID: N4xAMT5Odl_MCrZHs-uzefP1yTpaZxuyyQgTdesG0Kg
Cover

How React Testing Library Can Improve Your Mental Health [Part 2]

Written by @mac | Published on 2020/12/23

TL;DR
The key is to find the action type to set to the current todo element. We want to call appReducer with an initialState object, and a second argument. This one should be an object with type = “todos/todoAdded” and a payload. And then make sure that the result contains all previous todo with the one we passed as payload. Let’s go to nextTodoId (todos.reduce(maxId, todo) and test for that in the assertion.

[story continues]


Written by
@mac
During the day a developer. A husband and dad at night.

Topics and
tags
react|reactjs|unit-testing|testing|tutorial|tutorial-for-beginners|react-tutorial|hackernoon-top-story
This story on HackerNoon has a decentralized backup on Sia.
Transaction ID: N4xAMT5Odl_MCrZHs-uzefP1yTpaZxuyyQgTdesG0Kg