Testing Toggle Done Status Todo Endpoint¶
We now need to test if
is_done value toggles from
false and vice versa.
Since we deleted our only item from the database when we were testing deletion endpoint, we will have to create a new one in order to be able to test this functionality. You can repeat all the steps from section "Testing Add Todo Endpoint" and add a new item.But, since we already saved our "Add Todo Item" Request in Postman, we can use it.
You will just need to go to "Add Todo Item" tab in Postman and click "Send" button. That should basically again add a new todo item with title "Todo 1". Just like one we had before testing deletion.
The only value that will differ should be
_id since MongoDB generates a new random id everytime we create an item.
Read a lot more content with a free account.
Get access to our content and help us create even more great content by supporting us! 📝💯Login here