From b2c07c1e66eed4ab038a1e0f29f716178e652ed3 Mon Sep 17 00:00:00 2001 From: Diego Cohen Date: Tue, 31 Dec 2024 10:47:26 -0500 Subject: [PATCH] Add query getServerSideProps params in test --- __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 37ae9b71..c8f95b0e 100644 --- a/__test__/pages/hold/eddRequestPage.test.tsx +++ b/__test__/pages/hold/eddRequestPage.test.tsx @@ -93,12 +93,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() }) @@ -115,6 +117,7 @@ describe("EDD Request page", () => { params: { id }, req: mockReq, res: mockRes, + query: {}, }) expect(responseWithoutRedirect.redirect).not.toBeDefined() }) @@ -123,6 +126,7 @@ describe("EDD Request page", () => { params: { id }, req: mockReq, res: mockRes, + query: {}, }) expect(response.redirect).toBeUndefined() }) @@ -138,6 +142,7 @@ describe("EDD Request page", () => { params: { id }, res: mockRes, req: mockReq, + query: {}, }) expect(mockRes.setHeader.mock.calls[0]).toStrictEqual([ "Set-Cookie", @@ -163,6 +168,7 @@ describe("EDD Request page", () => { params: { id }, res: mockRes, req: mockReq, + query: {}, }) expect(responseWithAeonRedirect.redirect).toStrictEqual({ destination: bibWithSingleAeonItem.resource.items[0].aeonUrl[0],