paint-brush
How React Testing Library Can Improve Your Mental Health [Part 2]by@mac
758 reads
758 reads

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

by Mac WasilewskiDecember 23rd, 2020
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

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.
featured image - How React Testing Library Can Improve Your Mental Health [Part 2]
Mac Wasilewski HackerNoon profile picture
Mac Wasilewski

Mac Wasilewski

@mac

L O A D I N G
. . . comments & more!

About Author

Mac Wasilewski HackerNoon profile picture
Mac Wasilewski@mac

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite