Skip to content
This repository has been archived by the owner on Feb 4, 2024. It is now read-only.

Commit

Permalink
Adding test case
Browse files Browse the repository at this point in the history
  • Loading branch information
pablo268la committed May 3, 2022
1 parent 18c5727 commit 00ec33a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion restapi/tests/orders.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,17 @@ describe("orders", () => {
expect(response.statusCode).toBe(403);
});

it("Can't get order from other user", async () => {
it("Can get order from other user as admin", async () => {
const response: Response = await request(app)
.get("/orders/findByOrderCode/c34sfff0-389d-4bee-a3f5-37dd90a5e101")
.set("token", "test");
expect(response.statusCode).toBe(200);
});

it("Can't get order from other user", async () => {
const response: Response = await request(app)
.get("/orders/findByOrderCode/c34sfff0-389d-4bee-a3f5-37dd90a5e101")
.set("token", "webId");
expect(response.statusCode).toBe(409);
});
});

0 comments on commit 00ec33a

Please sign in to comment.