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 Wasilewski16mDecember 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.

Companies Mentioned

Mention Thumbnail
Mention Thumbnail
featured image - How React Testing Library Can Improve Your Mental Health [Part 2]
Mac Wasilewski HackerNoon profile picture
Mac Wasilewski

Mac Wasilewski

@mac

During the day a developer. A husband and dad at night.

About @mac
LEARN MORE ABOUT @MAC'S
EXPERTISE AND PLACE ON THE INTERNET.

Share Your Thoughts

About Author

Mac Wasilewski HackerNoon profile picture
Mac Wasilewski@mac
During the day a developer. A husband and dad at night.

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
L O A D I N G
. . . comments & more!