From e60ed4ece55897acc84a2c15ed9e16cf35cbf6e1 Mon Sep 17 00:00:00 2001 From: Diego Cohen Date: Tue, 19 Nov 2024 17:02:14 -0500 Subject: [PATCH] Add query to mocked getServerSideProps --- __test__/pages/hold/eddRequestPage.test.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/__test__/pages/hold/eddRequestPage.test.tsx b/__test__/pages/hold/eddRequestPage.test.tsx index 353fc9cc4..b2053cc35 100644 --- a/__test__/pages/hold/eddRequestPage.test.tsx +++ b/__test__/pages/hold/eddRequestPage.test.tsx @@ -73,12 +73,14 @@ describe("EDD Request page", () => { params: { id }, req: mockReq, res: mockRes, + query: {}, }) expect(responseWithZeroRedirects.redirect).toBeDefined() const responseWithTwoRedirects = await getServerSideProps({ params: { id: "123-456" }, req: { ...mockReq, cookies: { nyplAccountRedirects: 2 } }, res: mockRes, + query: {}, }) expect(responseWithTwoRedirects.redirect).toBeDefined() }) @@ -95,6 +97,7 @@ describe("EDD Request page", () => { params: { id }, req: mockReq, res: mockRes, + query: {}, }) expect(responseWithoutRedirect.redirect).not.toBeDefined() }) @@ -103,6 +106,7 @@ describe("EDD Request page", () => { params: { id }, req: mockReq, res: mockRes, + query: {}, }) expect(response.redirect).toBeUndefined() }) @@ -118,6 +122,7 @@ describe("EDD Request page", () => { params: { id }, res: mockRes, req: mockReq, + query: {}, }) expect(mockRes.setHeader.mock.calls[0]).toStrictEqual([ "Set-Cookie", @@ -143,6 +148,7 @@ describe("EDD Request page", () => { params: { id }, res: mockRes, req: mockReq, + query: {}, }) expect(responseWithAeonRedirect.redirect).toStrictEqual({ destination: bibWithSingleAeonItem.resource.items[0].aeonUrl[0],