From 313797c19379b2babab89389673bf60747f8424d Mon Sep 17 00:00:00 2001 From: EresDev Date: Thu, 31 Oct 2024 07:08:27 -0400 Subject: [PATCH] test: respond with err for invalid order id --- tests/unit/get-order.test.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/unit/get-order.test.ts b/tests/unit/get-order.test.ts index 7bd7f10a..ca92a06c 100644 --- a/tests/unit/get-order.test.ts +++ b/tests/unit/get-order.test.ts @@ -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."); + }); });