From the course: Learning End-to-End Testing with Jest
Unlock the full course today
Join today to access over 24,700 courses taught by industry experts.
Test the Delete endpoint
From the course: Learning End-to-End Testing with Jest
Test the Delete endpoint
- It's time to write some tests for the deletes end-point. Let's get right into it. For delete end-point, let's group each test in a described method with description: delete forward slash recipes forward slash ID. The positive tests description is: delete the specified recipe. (typing on keyboard) Call the end-point with the ID of the recipe you want to delete from the database. Because this is still a rights to database and sensitive, we have to set the authorization. You don't want unauthorized users making changes to your database. (typing on keyboard) We expect the response status code to be 200, (typing on keyboard) and response body to be an object containing success through and message 'recipe successfully deleted.' Server run test. Good. 20 tests pass. Our coverage is now 95.65%. Let's consider an unauthorized user. Test description is 'failed to delete the specified recipe, invalid token'. (typing on…
Contents
-
-
-
-
-
(Locked)
Test the Login endpoint6m 50s
-
(Locked)
Finish up on Login endpoint test7m 1s
-
(Locked)
Test the Create endpoint5m 16s
-
(Locked)
Finish up on Create endpoint test6m 27s
-
(Locked)
Test the Read endpoint5m 21s
-
(Locked)
Test the Update endpoint6m 44s
-
(Locked)
Finish up on Update endpoint test6m 1s
-
(Locked)
Test the Delete endpoint3m 55s
-
(Locked)
-
-