Skip to content

Commit

Permalink
test: respond with err for invalid order id
Browse files Browse the repository at this point in the history
  • Loading branch information
EresDev committed Oct 31, 2024
1 parent c7f202d commit 313797c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/unit/get-order.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,13 @@ describe("Get best payment card", () => {
expect(response.status).toBe(200);
expect(await response.json()).toEqual(order);
});

it("should respond with error for invalid order id", async () => {
const path = `/get-order?orderId=0xd89d85e5f65499e03f85cf5d4e69d04ee04d959cc04f8aa6a9fccba52b3c6917`;
const eventCtx = createEventContext(path, execContext);
const response = await pagesFunction(eventCtx);
await waitOnExecutionContext(execContext);
expect(response.status).toBe(404);
expect(await response.json()).toEqual("Order not found.");
});
});

0 comments on commit 313797c

Please sign in to comment.