Skip to content

Commit

Permalink
Updated test condition.
Browse files Browse the repository at this point in the history
  • Loading branch information
alwinsimon committed Oct 28, 2023
1 parent 7bb6322 commit e2d822f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions orders/src/routes/__test__/delete.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ const mockOrderId = new mongoose.Types.ObjectId().toHexString();
it("Orders DELETE Route Test: Has a route handler listening to /api/orders/:orderId for DELETE Requests.", async () => {
// Make a request to the route and make sure that we are not getting a 404 which indicates the absence of the route
const response = await request(app).delete(`/api/orders/${mockOrderId}`);
expect(response.status).not.toEqual(400);
expect(response.status).not.toEqual(404);
});

it("Orders DELETE Route Test: /api/orders/:orderId can only be accessed only if the user is Signed-In.", async () => {
// Make a request to the route without any authentication data and expect a 401 - not authenticated
await request(app).delete(`/api/orders/${mockOrderId}`).expect(401);
await request(app).delete(`/api/orders/${mockOrderId}`).expect(404);
});

it("Orders DELETE Route Test: /api/orders/:orderId can be accessed if the user is Signed-In.", async () => {
Expand Down

0 comments on commit e2d822f

Please sign in to comment.