From dbfc08c49e8bb538e9e9fa8cf5e7e40bafc8088a Mon Sep 17 00:00:00 2001 From: ThomasDos Date: Mon, 15 Jul 2024 11:49:36 +0200 Subject: [PATCH] fix(api): prisma queries used in tests --- .../security/candidacy.security.test.ts | 6 +++- .../modules/feasibility/feasibility.test.ts | 6 +++- .../validation/feasibility-checks.test.ts | 36 ++++++++++++------- 3 files changed, 34 insertions(+), 14 deletions(-) diff --git a/packages/reva-api/modules/candidacy/security/candidacy.security.test.ts b/packages/reva-api/modules/candidacy/security/candidacy.security.test.ts index 9924b9cf7..3c877935b 100644 --- a/packages/reva-api/modules/candidacy/security/candidacy.security.test.ts +++ b/packages/reva-api/modules/candidacy/security/candidacy.security.test.ts @@ -161,7 +161,11 @@ beforeAll(async () => { feasibility = await prismaClient.feasibility.create({ data: { candidacyId: candidacy.id, - feasibilityFileId: feasibilityFile.id, + feasibilityUploadedPdf: { + create: { + feasibilityFileId: feasibilityFile.id, + }, + }, certificationAuthorityId: certificationAuthority.id, }, }); diff --git a/packages/reva-api/modules/feasibility/feasibility.test.ts b/packages/reva-api/modules/feasibility/feasibility.test.ts index 16cce758b..685eddb93 100644 --- a/packages/reva-api/modules/feasibility/feasibility.test.ts +++ b/packages/reva-api/modules/feasibility/feasibility.test.ts @@ -161,7 +161,11 @@ async function createFeasibility(account: Account) { return await prismaClient.feasibility.create({ data: { candidacyId: candidacy.id, - feasibilityFileId: feasibilityFile.id, + feasibilityUploadedPdf: { + create: { + feasibilityFileId: feasibilityFile.id, + }, + }, certificationAuthorityId: account.certificationAuthorityId ?? "", }, }); diff --git a/packages/reva-api/modules/finance/unifvae/validation/feasibility-checks.test.ts b/packages/reva-api/modules/finance/unifvae/validation/feasibility-checks.test.ts index 848995126..de66825b7 100644 --- a/packages/reva-api/modules/finance/unifvae/validation/feasibility-checks.test.ts +++ b/packages/reva-api/modules/finance/unifvae/validation/feasibility-checks.test.ts @@ -21,11 +21,15 @@ describe("FundingRequesUnifvae Feasibility checks", () => { create: { decision: "ADMISSIBLE", certificationAuthority: { create: { label: "dummy" } }, - feasibilityFile: { + feasibilityUploadedPdf: { create: { - name: "dummyFile.ext", - mimeType: "kikoo/lol", - path: "dummyFile.ext", + feasibilityFile: { + create: { + name: "dummyFile.ext", + mimeType: "kikoo/lol", + path: "dummyFile.ext", + }, + }, }, }, }, @@ -38,11 +42,15 @@ describe("FundingRequesUnifvae Feasibility checks", () => { create: { decision: "REJECTED", certificationAuthority: { create: { label: "dummy" } }, - feasibilityFile: { + feasibilityUploadedPdf: { create: { - name: "dummyFile.ext", - mimeType: "kikoo/lol", - path: "dummyFile.ext", + feasibilityFile: { + create: { + name: "dummyFile.ext", + mimeType: "kikoo/lol", + path: "dummyFile.ext", + }, + }, }, }, }, @@ -55,11 +63,15 @@ describe("FundingRequesUnifvae Feasibility checks", () => { create: { decision: "PENDING", certificationAuthority: { create: { label: "dummy" } }, - feasibilityFile: { + feasibilityUploadedPdf: { create: { - name: "dummyFile.ext", - mimeType: "kikoo/lol", - path: "dummyFile.ext", + feasibilityFile: { + create: { + name: "dummyFile.ext", + mimeType: "kikoo/lol", + path: "dummyFile.ext", + }, + }, }, }, },