diff --git a/api.planx.uk/admin/session/bops.test.ts b/api.planx.uk/admin/session/bops.test.ts index 825ff8ce6e..5665ae9c09 100644 --- a/api.planx.uk/admin/session/bops.test.ts +++ b/api.planx.uk/admin/session/bops.test.ts @@ -6,9 +6,7 @@ import { expectedPayload } from "../../tests/mocks/bopsMocks"; const endpoint = (strings: TemplateStringsArray) => `/admin/session/${strings[0]}/bops`; -const mockGenerateBOPSPayload = jest.fn().mockResolvedValue({ - exportData: expectedPayload, -}); +const mockGenerateBOPSPayload = jest.fn().mockResolvedValue(expectedPayload); jest.mock("@opensystemslab/planx-core", () => { return { diff --git a/api.planx.uk/admin/session/csv.test.ts b/api.planx.uk/admin/session/csv.test.ts index a493fb410d..a40152a272 100644 --- a/api.planx.uk/admin/session/csv.test.ts +++ b/api.planx.uk/admin/session/csv.test.ts @@ -5,16 +5,13 @@ import { authHeader } from "../../tests/mockJWT"; const endpoint = (strings: TemplateStringsArray) => `/admin/session/${strings[0]}/csv`; -const mockGenerateCSVData = jest.fn().mockResolvedValue({ - responses: [ - { - question: "Is this a test?", - responses: [{ value: "Yes" }], - metadata: {}, - }, - ], - redactedResponses: [], -}); +const mockGenerateCSVData = jest.fn().mockResolvedValue([ + { + question: "Is this a test?", + responses: [{ value: "Yes" }], + metadata: {}, + }, +]); jest.mock("@opensystemslab/planx-core", () => { return { CoreDomainClient: jest.fn().mockImplementation(() => ({ diff --git a/api.planx.uk/admin/session/oneAppXML.test.ts b/api.planx.uk/admin/session/oneAppXML.test.ts index 8a67e626b2..4b8dc3bfe3 100644 --- a/api.planx.uk/admin/session/oneAppXML.test.ts +++ b/api.planx.uk/admin/session/oneAppXML.test.ts @@ -12,7 +12,9 @@ const mockGenerateOneAppXML = jest jest.mock("../../client", () => { return { $api: { - generateOneAppXML: () => mockGenerateOneAppXML(), + export: { + oneAppPayload: () => mockGenerateOneAppXML(), + }, }, }; }); diff --git a/api.planx.uk/send/email.test.ts b/api.planx.uk/send/email.test.ts index 12cb25ab54..398f6d8889 100644 --- a/api.planx.uk/send/email.test.ts +++ b/api.planx.uk/send/email.test.ts @@ -2,16 +2,13 @@ import supertest from "supertest"; import { queryMock } from "../tests/graphqlQueryMock"; import app from "../server"; -const mockGenerateCSVData = jest.fn().mockResolvedValue({ - responses: [ - { - question: "Is this a test?", - responses: [{ value: "Yes" }], - metadata: {}, - }, - ], - redactedResponses: [], -}); +const mockGenerateCSVData = jest.fn().mockResolvedValue([ + { + question: "Is this a test?", + responses: [{ value: "Yes" }], + metadata: {}, + }, +]); jest.mock("@opensystemslab/planx-core", () => { return { Passport: jest.fn().mockImplementation(() => ({ diff --git a/api.planx.uk/send/exportZip.test.ts b/api.planx.uk/send/exportZip.test.ts index 39ce06e6b2..2ecb05da89 100644 --- a/api.planx.uk/send/exportZip.test.ts +++ b/api.planx.uk/send/exportZip.test.ts @@ -58,7 +58,6 @@ const mockGenerateOneAppXML = jest jest.mock("../client", () => { return { $api: { - generateOneAppXML: () => mockGenerateOneAppXML(), getDocumentTemplateNamesForSession: jest .fn() .mockResolvedValue(["X", "Y"]), @@ -66,16 +65,15 @@ jest.mock("../client", () => { find: () => mockGetSessionById(), }, export: { - csvData: jest.fn().mockResolvedValue({ - responses: [ - { - question: "Test", - responses: [{ value: "Answer" }], - metadata: {}, - }, - ], - redactedResponses: [], - }), + csvData: jest.fn().mockResolvedValue([ + { + question: "Test", + responses: [{ value: "Answer" }], + metadata: {}, + }, + ]), + csvDataRedacted: jest.fn().mockResolvedValue([]), + oneAppPayload: () => mockGenerateOneAppXML(), }, }, };