diff --git a/api.planx.uk/modules/pay/service/inviteToPay/createPaymentSendEvents.test.ts b/api.planx.uk/modules/pay/service/inviteToPay/createPaymentSendEvents.test.ts index 09fc3cf2fc..c92770e703 100644 --- a/api.planx.uk/modules/pay/service/inviteToPay/createPaymentSendEvents.test.ts +++ b/api.planx.uk/modules/pay/service/inviteToPay/createPaymentSendEvents.test.ts @@ -77,7 +77,7 @@ describe("Create payment send events webhook", () => { it("returns a 400 if a required value is missing", async () => { await supertest(app) .post(ENDPOINT) - .set({ Authorization: process.env.HASURA_PLANX_API_KEY }) + .set({ Authorization: process.env.HASURA_PLANX_API_KEY! }) .send({ payload: { somethingElse: "123" } }) .expect(400) .then((response) => @@ -92,7 +92,7 @@ describe("Create payment send events webhook", () => { await supertest(app) .post(ENDPOINT) - .set({ Authorization: process.env.HASURA_PLANX_API_KEY }) + .set({ Authorization: process.env.HASURA_PLANX_API_KEY! }) .send({ payload: { sessionId: "123" } }) .expect(200) .then((response) => { @@ -108,7 +108,7 @@ describe("Create payment send events webhook", () => { await supertest(app) .post(ENDPOINT) - .set({ Authorization: process.env.HASURA_PLANX_API_KEY }) + .set({ Authorization: process.env.HASURA_PLANX_API_KEY! }) .send(body) .expect(200) .then((response) => { @@ -131,7 +131,7 @@ describe("Create payment send events webhook", () => { await supertest(app) .post(ENDPOINT) - .set({ Authorization: process.env.HASURA_PLANX_API_KEY }) + .set({ Authorization: process.env.HASURA_PLANX_API_KEY! }) .send(body) .expect(500) .then((response) => { diff --git a/api.planx.uk/modules/send/bops/bops.test.ts b/api.planx.uk/modules/send/bops/bops.test.ts index 4a6d5051c2..cdcbd6f6e3 100644 --- a/api.planx.uk/modules/send/bops/bops.test.ts +++ b/api.planx.uk/modules/send/bops/bops.test.ts @@ -95,7 +95,7 @@ describe(`sending an application to BOPS`, () => { await supertest(app) .post("/bops/southwark") - .set({ Authorization: process.env.HASURA_PLANX_API_KEY }) + .set({ Authorization: process.env.HASURA_PLANX_API_KEY! }) .send({ payload: { sessionId: "123" } }) .expect(200) .then((res) => { @@ -115,7 +115,7 @@ describe(`sending an application to BOPS`, () => { it("throws an error if payload is missing", async () => { await supertest(app) .post("/bops/southwark") - .set({ Authorization: process.env.HASURA_PLANX_API_KEY }) + .set({ Authorization: process.env.HASURA_PLANX_API_KEY! }) .send({ payload: null }) .expect(400) .then((res) => { @@ -126,7 +126,7 @@ describe(`sending an application to BOPS`, () => { it("throws an error if team is unsupported", async () => { await supertest(app) .post("/bops/unsupported-team") - .set({ Authorization: process.env.HASURA_PLANX_API_KEY }) + .set({ Authorization: process.env.HASURA_PLANX_API_KEY! }) .send({ payload: { sessionId: "123" } }) .expect(400) .then((res) => { @@ -150,7 +150,7 @@ describe(`sending an application to BOPS`, () => { await supertest(app) .post("/bops/southwark") - .set({ Authorization: process.env.HASURA_PLANX_API_KEY }) + .set({ Authorization: process.env.HASURA_PLANX_API_KEY! }) .send({ payload: { sessionId: "previously_submitted_app" } }) .expect(200) .then((res) => { @@ -226,7 +226,7 @@ describe(`sending an application to BOPS v2`, () => { await supertest(app) .post("/bops-v2/southwark") - .set({ Authorization: process.env.HASURA_PLANX_API_KEY }) + .set({ Authorization: process.env.HASURA_PLANX_API_KEY! }) .send({ payload: { sessionId: "123" } }) .expect(200) .then((res) => { @@ -246,7 +246,7 @@ describe(`sending an application to BOPS v2`, () => { it("throws an error if payload is missing", async () => { await supertest(app) .post("/bops-v2/southwark") - .set({ Authorization: process.env.HASURA_PLANX_API_KEY }) + .set({ Authorization: process.env.HASURA_PLANX_API_KEY! }) .send({ payload: null }) .expect(400) .then((res) => { @@ -257,7 +257,7 @@ describe(`sending an application to BOPS v2`, () => { it("throws an error if team is unsupported", async () => { await supertest(app) .post("/bops-v2/unsupported-team") - .set({ Authorization: process.env.HASURA_PLANX_API_KEY }) + .set({ Authorization: process.env.HASURA_PLANX_API_KEY! }) .send({ payload: { sessionId: "123" } }) .expect(400) .then((res) => { @@ -281,7 +281,7 @@ describe(`sending an application to BOPS v2`, () => { await supertest(app) .post("/bops-v2/southwark") - .set({ Authorization: process.env.HASURA_PLANX_API_KEY }) + .set({ Authorization: process.env.HASURA_PLANX_API_KEY! }) .send({ payload: { sessionId: "previously_submitted_app" } }) .expect(200) .then((res) => { diff --git a/api.planx.uk/modules/send/email/index.test.ts b/api.planx.uk/modules/send/email/index.test.ts index 891230c689..692cbbd98b 100644 --- a/api.planx.uk/modules/send/email/index.test.ts +++ b/api.planx.uk/modules/send/email/index.test.ts @@ -113,7 +113,7 @@ describe(`sending an application by email to a planning office`, () => { it("succeeds when provided with valid data", async () => { await supertest(app) .post("/email-submission/southwark") - .set({ Authorization: process.env.HASURA_PLANX_API_KEY }) + .set({ Authorization: process.env.HASURA_PLANX_API_KEY! }) .send({ payload: { sessionId: "123" } }) .expect(200) .then((res) => { @@ -133,7 +133,7 @@ describe(`sending an application by email to a planning office`, () => { it("errors if the payload body does not include a sessionId", async () => { await supertest(app) .post("/email-submission/southwark") - .set({ Authorization: process.env.HASURA_PLANX_API_KEY }) + .set({ Authorization: process.env.HASURA_PLANX_API_KEY! }) .send({ payload: { somethingElse: "123" } }) .expect(400) .then((res) => { @@ -160,7 +160,7 @@ describe(`sending an application by email to a planning office`, () => { await supertest(app) .post("/email-submission/other-council") - .set({ Authorization: process.env.HASURA_PLANX_API_KEY }) + .set({ Authorization: process.env.HASURA_PLANX_API_KEY! }) .send({ payload: { sessionId: "123" } }) .expect(400) .then((res) => { @@ -183,7 +183,7 @@ describe(`sending an application by email to a planning office`, () => { await supertest(app) .post("/email-submission/other-council") - .set({ Authorization: process.env.HASURA_PLANX_API_KEY }) + .set({ Authorization: process.env.HASURA_PLANX_API_KEY! }) .send({ payload: { sessionId: "123" } }) .expect(500) .then((res) => { diff --git a/api.planx.uk/modules/send/uniform/uniform.test.ts b/api.planx.uk/modules/send/uniform/uniform.test.ts index 4e6aaea544..1ba467ac74 100644 --- a/api.planx.uk/modules/send/uniform/uniform.test.ts +++ b/api.planx.uk/modules/send/uniform/uniform.test.ts @@ -12,7 +12,7 @@ describe(`sending an application to uniform`, () => { it("errors if the payload body does not include a sessionId", async () => { await supertest(app) .post("/uniform/southwark") - .set({ Authorization: process.env.HASURA_PLANX_API_KEY }) + .set({ Authorization: process.env.HASURA_PLANX_API_KEY! }) .send({ payload: { somethingElse: "123" } }) .expect(400) .then((res) => { diff --git a/api.planx.uk/modules/webhooks/service/analyzeSessions/index.test.ts b/api.planx.uk/modules/webhooks/service/analyzeSessions/index.test.ts index 32a0119801..da959adab7 100644 --- a/api.planx.uk/modules/webhooks/service/analyzeSessions/index.test.ts +++ b/api.planx.uk/modules/webhooks/service/analyzeSessions/index.test.ts @@ -38,7 +38,7 @@ describe("Analyze sessions webhook", () => { mockOperationHandler.mockRejectedValueOnce("Unhandled error!"); await post(ENDPOINT) - .set({ Authorization: process.env.HASURA_PLANX_API_KEY }) + .set({ Authorization: process.env.HASURA_PLANX_API_KEY! }) .expect(500) .then((response) => expect(response.body.error).toMatch( @@ -63,7 +63,7 @@ describe("Analyze sessions webhook", () => { ]); await post(ENDPOINT) - .set({ Authorization: process.env.HASURA_PLANX_API_KEY }) + .set({ Authorization: process.env.HASURA_PLANX_API_KEY! }) .expect(200) .then((response) => { expect(mockOperation1).toHaveBeenCalled(); @@ -107,7 +107,7 @@ describe("Analyze sessions webhook", () => { ]); await post(ENDPOINT) - .set({ Authorization: process.env.HASURA_PLANX_API_KEY }) + .set({ Authorization: process.env.HASURA_PLANX_API_KEY! }) .expect(500) .then((response) => { expect(mockOperation1).toHaveBeenCalled(); @@ -164,7 +164,7 @@ describe("Analyze sessions webhook", () => { ]); await post(ENDPOINT) - .set({ Authorization: process.env.HASURA_PLANX_API_KEY }) + .set({ Authorization: process.env.HASURA_PLANX_API_KEY! }) .expect(500) .then((response) => { expect(mockOperation1).toHaveBeenCalled(); diff --git a/api.planx.uk/modules/webhooks/service/lowcalSessionEvents/index.test.ts b/api.planx.uk/modules/webhooks/service/lowcalSessionEvents/index.test.ts index ac5e7cb5b2..e9b4b2bcf8 100644 --- a/api.planx.uk/modules/webhooks/service/lowcalSessionEvents/index.test.ts +++ b/api.planx.uk/modules/webhooks/service/lowcalSessionEvents/index.test.ts @@ -50,7 +50,7 @@ describe("Create reminder event webhook", () => { for (const body of invalidRequestBodies) { await post(ENDPOINT) - .set({ Authorization: process.env.HASURA_PLANX_API_KEY }) + .set({ Authorization: process.env.HASURA_PLANX_API_KEY! }) .send(body) .expect(400) .then((response) => { @@ -68,7 +68,7 @@ describe("Create reminder event webhook", () => { mockedCreateScheduledEvent.mockResolvedValue(mockScheduledEventResponse); await post(ENDPOINT) - .set({ Authorization: process.env.HASURA_PLANX_API_KEY }) + .set({ Authorization: process.env.HASURA_PLANX_API_KEY! }) .send(body) .expect(200) .then((response) => { @@ -89,7 +89,7 @@ describe("Create reminder event webhook", () => { mockedCreateScheduledEvent.mockResolvedValue(mockScheduledEventResponse); await post(ENDPOINT) - .set({ Authorization: process.env.HASURA_PLANX_API_KEY }) + .set({ Authorization: process.env.HASURA_PLANX_API_KEY! }) .send(body) .expect(200) .then((response) => { @@ -124,7 +124,7 @@ describe("Create reminder event webhook", () => { mockedCreateScheduledEvent.mockRejectedValue(new Error("Failed!")); await post(ENDPOINT) - .set({ Authorization: process.env.HASURA_PLANX_API_KEY }) + .set({ Authorization: process.env.HASURA_PLANX_API_KEY! }) .send(body) .expect(500) .then((response) => { @@ -156,7 +156,7 @@ describe("Create expiry event webhook", () => { for (const body of [missingCreatedAt, missingPayload]) { await post(ENDPOINT) - .set({ Authorization: process.env.HASURA_PLANX_API_KEY }) + .set({ Authorization: process.env.HASURA_PLANX_API_KEY! }) .send(body) .expect(400) .then((response) => { @@ -174,7 +174,7 @@ describe("Create expiry event webhook", () => { mockedCreateScheduledEvent.mockResolvedValue(mockScheduledEventResponse); await post(ENDPOINT) - .set({ Authorization: process.env.HASURA_PLANX_API_KEY }) + .set({ Authorization: process.env.HASURA_PLANX_API_KEY! }) .send(body) .expect(200) .then((response) => { @@ -191,7 +191,7 @@ describe("Create expiry event webhook", () => { mockedCreateScheduledEvent.mockResolvedValue(mockScheduledEventResponse); await post(ENDPOINT) - .set({ Authorization: process.env.HASURA_PLANX_API_KEY }) + .set({ Authorization: process.env.HASURA_PLANX_API_KEY! }) .send(body) .expect(200) .then((response) => { @@ -211,7 +211,7 @@ describe("Create expiry event webhook", () => { mockedCreateScheduledEvent.mockRejectedValue(new Error("Failed!")); await post(ENDPOINT) - .set({ Authorization: process.env.HASURA_PLANX_API_KEY }) + .set({ Authorization: process.env.HASURA_PLANX_API_KEY! }) .send(body) .expect(500) .then((response) => { diff --git a/api.planx.uk/modules/webhooks/service/paymentRequestEvents/index.test.ts b/api.planx.uk/modules/webhooks/service/paymentRequestEvents/index.test.ts index 70fd705cdc..dc9346aeb9 100644 --- a/api.planx.uk/modules/webhooks/service/paymentRequestEvents/index.test.ts +++ b/api.planx.uk/modules/webhooks/service/paymentRequestEvents/index.test.ts @@ -36,7 +36,7 @@ describe("Create payment invitation events webhook", () => { for (const body of [missingCreatedAt, missingPayload]) { await post(ENDPOINT) - .set({ Authorization: process.env.HASURA_PLANX_API_KEY }) + .set({ Authorization: process.env.HASURA_PLANX_API_KEY! }) .send(body) .expect(400) .then((response) => { @@ -54,7 +54,7 @@ describe("Create payment invitation events webhook", () => { mockedCreateScheduledEvent.mockResolvedValue(mockScheduledEventResponse); await post(ENDPOINT) - .set({ Authorization: process.env.HASURA_PLANX_API_KEY }) + .set({ Authorization: process.env.HASURA_PLANX_API_KEY! }) .send(body) .expect(200) .then((response) => { @@ -75,7 +75,7 @@ describe("Create payment invitation events webhook", () => { mockedCreateScheduledEvent.mockResolvedValue(mockScheduledEventResponse); await post(ENDPOINT) - .set({ Authorization: process.env.HASURA_PLANX_API_KEY }) + .set({ Authorization: process.env.HASURA_PLANX_API_KEY! }) .send(body) .expect(200) .then((response) => { @@ -113,7 +113,7 @@ describe("Create payment invitation events webhook", () => { mockedCreateScheduledEvent.mockRejectedValue(new Error("Failed!")); await post(ENDPOINT) - .set({ Authorization: process.env.HASURA_PLANX_API_KEY }) + .set({ Authorization: process.env.HASURA_PLANX_API_KEY! }) .send(body) .expect(500) .then((response) => { @@ -145,7 +145,7 @@ describe("Create payment reminder events webhook", () => { for (const body of [missingCreatedAt, missingPayload]) { await post(ENDPOINT) - .set({ Authorization: process.env.HASURA_PLANX_API_KEY }) + .set({ Authorization: process.env.HASURA_PLANX_API_KEY! }) .send(body) .expect(400) .then((response) => { @@ -163,7 +163,7 @@ describe("Create payment reminder events webhook", () => { mockedCreateScheduledEvent.mockResolvedValue(mockScheduledEventResponse); await post(ENDPOINT) - .set({ Authorization: process.env.HASURA_PLANX_API_KEY }) + .set({ Authorization: process.env.HASURA_PLANX_API_KEY! }) .send(body) .expect(200) .then((response) => { @@ -186,7 +186,7 @@ describe("Create payment reminder events webhook", () => { mockedCreateScheduledEvent.mockResolvedValue(mockScheduledEventResponse); await post(ENDPOINT) - .set({ Authorization: process.env.HASURA_PLANX_API_KEY }) + .set({ Authorization: process.env.HASURA_PLANX_API_KEY! }) .send(body) .expect(200) .then((response) => { @@ -244,7 +244,7 @@ describe("Create payment reminder events webhook", () => { mockedCreateScheduledEvent.mockRejectedValue(new Error("Failed!")); await post(ENDPOINT) - .set({ Authorization: process.env.HASURA_PLANX_API_KEY }) + .set({ Authorization: process.env.HASURA_PLANX_API_KEY! }) .send(body) .expect(500) .then((response) => { @@ -276,7 +276,7 @@ describe("Create payment expiry events webhook", () => { for (const body of [missingCreatedAt, missingPayload]) { await post(ENDPOINT) - .set({ Authorization: process.env.HASURA_PLANX_API_KEY }) + .set({ Authorization: process.env.HASURA_PLANX_API_KEY! }) .send(body) .expect(400) .then((response) => { @@ -294,7 +294,7 @@ describe("Create payment expiry events webhook", () => { mockedCreateScheduledEvent.mockResolvedValue(mockScheduledEventResponse); await post(ENDPOINT) - .set({ Authorization: process.env.HASURA_PLANX_API_KEY }) + .set({ Authorization: process.env.HASURA_PLANX_API_KEY! }) .send(body) .expect(200) .then((response) => { @@ -315,7 +315,7 @@ describe("Create payment expiry events webhook", () => { mockedCreateScheduledEvent.mockResolvedValue(mockScheduledEventResponse); await post(ENDPOINT) - .set({ Authorization: process.env.HASURA_PLANX_API_KEY }) + .set({ Authorization: process.env.HASURA_PLANX_API_KEY! }) .send(body) .expect(200) .then((response) => { @@ -353,7 +353,7 @@ describe("Create payment expiry events webhook", () => { mockedCreateScheduledEvent.mockRejectedValue(new Error("Failed!")); await post(ENDPOINT) - .set({ Authorization: process.env.HASURA_PLANX_API_KEY }) + .set({ Authorization: process.env.HASURA_PLANX_API_KEY! }) .send(body) .expect(500) .then((response) => { diff --git a/api.planx.uk/modules/webhooks/service/sanitiseApplicationData/index.test.ts b/api.planx.uk/modules/webhooks/service/sanitiseApplicationData/index.test.ts index a4930c9178..52457fa67f 100644 --- a/api.planx.uk/modules/webhooks/service/sanitiseApplicationData/index.test.ts +++ b/api.planx.uk/modules/webhooks/service/sanitiseApplicationData/index.test.ts @@ -33,7 +33,7 @@ describe("Sanitise application data webhook", () => { mockOperationHandler.mockRejectedValueOnce("Unhandled error!"); await post(ENDPOINT) - .set({ Authorization: process.env.HASURA_PLANX_API_KEY }) + .set({ Authorization: process.env.HASURA_PLANX_API_KEY! }) .expect(500) .then((response) => expect(response.body.error).toMatch( @@ -55,7 +55,7 @@ describe("Sanitise application data webhook", () => { ]); await post(ENDPOINT) - .set({ Authorization: process.env.HASURA_PLANX_API_KEY }) + .set({ Authorization: process.env.HASURA_PLANX_API_KEY! }) .expect(200) .then((response) => { expect(mockOperation1).toHaveBeenCalled(); @@ -96,7 +96,7 @@ describe("Sanitise application data webhook", () => { ]); await post(ENDPOINT) - .set({ Authorization: process.env.HASURA_PLANX_API_KEY }) + .set({ Authorization: process.env.HASURA_PLANX_API_KEY! }) .expect(500) .then((response) => { expect(mockOperation1).toHaveBeenCalled(); @@ -150,7 +150,7 @@ describe("Sanitise application data webhook", () => { ]); await post(ENDPOINT) - .set({ Authorization: process.env.HASURA_PLANX_API_KEY }) + .set({ Authorization: process.env.HASURA_PLANX_API_KEY! }) .expect(500) .then((response) => { expect(mockOperation1).toHaveBeenCalled(); diff --git a/api.planx.uk/modules/webhooks/service/sendNotification/index.test.ts b/api.planx.uk/modules/webhooks/service/sendNotification/index.test.ts index 4fea47f742..18da1e4c94 100644 --- a/api.planx.uk/modules/webhooks/service/sendNotification/index.test.ts +++ b/api.planx.uk/modules/webhooks/service/sendNotification/index.test.ts @@ -75,7 +75,7 @@ describe("Send Slack notifications endpoint", () => { it("returns a 400 if 'type' is missing", async () => { const body = { event: {} }; await post(ENDPOINT) - .set({ Authorization: process.env.HASURA_PLANX_API_KEY }) + .set({ Authorization: process.env.HASURA_PLANX_API_KEY! }) .send(body) .expect(400) .then((response) => { @@ -87,7 +87,7 @@ describe("Send Slack notifications endpoint", () => { it("returns a 400 if 'type' is incorrect", async () => { const body = { event: {} }; await post(ENDPOINT + "?type=test-submission") - .set({ Authorization: process.env.HASURA_PLANX_API_KEY }) + .set({ Authorization: process.env.HASURA_PLANX_API_KEY! }) .send(body) .expect(400) .then((response) => { @@ -98,7 +98,7 @@ describe("Send Slack notifications endpoint", () => { it("returns a 400 if 'event' is missing", async () => { await post(ENDPOINT + "?type=bops-submission") - .set({ Authorization: process.env.HASURA_PLANX_API_KEY }) + .set({ Authorization: process.env.HASURA_PLANX_API_KEY! }) .expect(400) .then((response) => { expect(response.body).toHaveProperty("issues"); @@ -124,7 +124,7 @@ describe("Send Slack notifications endpoint", () => { process.env.APP_ENVIRONMENT = "staging"; await post(ENDPOINT) .query({ type: "bops-submission" }) - .set({ Authorization: process.env.HASURA_PLANX_API_KEY }) + .set({ Authorization: process.env.HASURA_PLANX_API_KEY! }) .send(body) .expect(200) .then((response) => { @@ -137,7 +137,7 @@ describe("Send Slack notifications endpoint", () => { await post(ENDPOINT) .query({ type: "bops-submission" }) - .set({ Authorization: process.env.HASURA_PLANX_API_KEY }) + .set({ Authorization: process.env.HASURA_PLANX_API_KEY! }) .send(body) .expect(200) .then((response) => { @@ -157,7 +157,7 @@ describe("Send Slack notifications endpoint", () => { await post(ENDPOINT) .query({ type: "bops-submission" }) - .set({ Authorization: process.env.HASURA_PLANX_API_KEY }) + .set({ Authorization: process.env.HASURA_PLANX_API_KEY! }) .send(body) .expect(500) .then((response) => { @@ -186,7 +186,7 @@ describe("Send Slack notifications endpoint", () => { process.env.APP_ENVIRONMENT = "staging"; await post(ENDPOINT) .query({ type: "uniform-submission" }) - .set({ Authorization: process.env.HASURA_PLANX_API_KEY }) + .set({ Authorization: process.env.HASURA_PLANX_API_KEY! }) .send(body) .expect(200) .then((response) => { @@ -199,7 +199,7 @@ describe("Send Slack notifications endpoint", () => { await post(ENDPOINT) .query({ type: "uniform-submission" }) - .set({ Authorization: process.env.HASURA_PLANX_API_KEY }) + .set({ Authorization: process.env.HASURA_PLANX_API_KEY! }) .send(body) .expect(200) .then((response) => { @@ -221,7 +221,7 @@ describe("Send Slack notifications endpoint", () => { await post(ENDPOINT) .query({ type: "uniform-submission" }) - .set({ Authorization: process.env.HASURA_PLANX_API_KEY }) + .set({ Authorization: process.env.HASURA_PLANX_API_KEY! }) .send(body) .expect(200) .then((response) => { @@ -237,7 +237,7 @@ describe("Send Slack notifications endpoint", () => { await post(ENDPOINT) .query({ type: "uniform-submission" }) - .set({ Authorization: process.env.HASURA_PLANX_API_KEY }) + .set({ Authorization: process.env.HASURA_PLANX_API_KEY! }) .send(body) .expect(200) .then((response) => { @@ -251,7 +251,7 @@ describe("Send Slack notifications endpoint", () => { await post(ENDPOINT) .query({ type: "uniform-submission" }) - .set({ Authorization: process.env.HASURA_PLANX_API_KEY }) + .set({ Authorization: process.env.HASURA_PLANX_API_KEY! }) .send(body) .expect(500) .then((response) => { @@ -266,7 +266,7 @@ describe("Send Slack notifications endpoint", () => { await post(ENDPOINT) .query({ type: "uniform-submission" }) - .set({ Authorization: process.env.HASURA_PLANX_API_KEY }) + .set({ Authorization: process.env.HASURA_PLANX_API_KEY! }) .send(body) .expect(500) .then((response) => { @@ -297,7 +297,7 @@ describe("Send Slack notifications endpoint", () => { process.env.APP_ENVIRONMENT = "staging"; await post(ENDPOINT) .query({ type: "email-submission" }) - .set({ Authorization: process.env.HASURA_PLANX_API_KEY }) + .set({ Authorization: process.env.HASURA_PLANX_API_KEY! }) .send(body) .expect(200) .then((response) => { @@ -310,7 +310,7 @@ describe("Send Slack notifications endpoint", () => { await post(ENDPOINT) .query({ type: "email-submission" }) - .set({ Authorization: process.env.HASURA_PLANX_API_KEY }) + .set({ Authorization: process.env.HASURA_PLANX_API_KEY! }) .send(body) .expect(200) .then((response) => { @@ -331,7 +331,7 @@ describe("Send Slack notifications endpoint", () => { await post(ENDPOINT) .query({ type: "email-submission" }) - .set({ Authorization: process.env.HASURA_PLANX_API_KEY }) + .set({ Authorization: process.env.HASURA_PLANX_API_KEY! }) .send(body) .expect(500) .then((response) => { diff --git a/api.planx.uk/modules/webhooks/service/validateInput/validateInput.test.ts b/api.planx.uk/modules/webhooks/service/validateInput/validateInput.test.ts index 07c7fd42c6..a1f87f754f 100644 --- a/api.planx.uk/modules/webhooks/service/validateInput/validateInput.test.ts +++ b/api.planx.uk/modules/webhooks/service/validateInput/validateInput.test.ts @@ -25,7 +25,7 @@ describe("Dirty HTML", () => { }; await post(ENDPOINT) - .set({ Authorization: process.env.HASURA_PLANX_API_KEY }) + .set({ Authorization: process.env.HASURA_PLANX_API_KEY! }) .send(body) .expect(400) .then((response) => { @@ -55,7 +55,7 @@ describe("Dirty HTML", () => { }; await post(ENDPOINT) - .set({ Authorization: process.env.HASURA_PLANX_API_KEY }) + .set({ Authorization: process.env.HASURA_PLANX_API_KEY! }) .send(body) .expect(400) .then((response) => { @@ -75,7 +75,7 @@ describe("Clean HTML", () => { }; await post(ENDPOINT) - .set({ Authorization: process.env.HASURA_PLANX_API_KEY }) + .set({ Authorization: process.env.HASURA_PLANX_API_KEY! }) .send(body) .expect(200) .then((response) => expect(response.body).toEqual({})); @@ -101,7 +101,7 @@ describe("Clean HTML", () => { }; await post(ENDPOINT) - .set({ Authorization: process.env.HASURA_PLANX_API_KEY }) + .set({ Authorization: process.env.HASURA_PLANX_API_KEY! }) .send(body) .expect(200) .then((response) => expect(response.body).toEqual({})); @@ -120,7 +120,7 @@ describe("Mixed clean and dirty HTML", () => { }; await post(ENDPOINT) - .set({ Authorization: process.env.HASURA_PLANX_API_KEY }) + .set({ Authorization: process.env.HASURA_PLANX_API_KEY! }) .send(body) .expect(400) .then((response) => { @@ -151,7 +151,7 @@ describe("Mixed clean and dirty HTML", () => { }; await post(ENDPOINT) - .set({ Authorization: process.env.HASURA_PLANX_API_KEY }) + .set({ Authorization: process.env.HASURA_PLANX_API_KEY! }) .send(body) .expect(400) .then((response) => { @@ -180,7 +180,7 @@ describe("Non-HTML input", () => { }; await post(ENDPOINT) - .set({ Authorization: process.env.HASURA_PLANX_API_KEY }) + .set({ Authorization: process.env.HASURA_PLANX_API_KEY! }) .send(body) .expect(200) .then((response) => expect(response.body).toEqual({})); @@ -213,7 +213,7 @@ describe("Non-HTML input", () => { }; await post(ENDPOINT) - .set({ Authorization: process.env.HASURA_PLANX_API_KEY }) + .set({ Authorization: process.env.HASURA_PLANX_API_KEY! }) .send(body) .expect(200) .then((response) => expect(response.body).toEqual({}));