From 753e1327f3cf730e87a4e52d333ee709f460c8c4 Mon Sep 17 00:00:00 2001 From: Mohammad Ranjbar Z Date: Tue, 28 Nov 2023 14:42:34 +0330 Subject: [PATCH] Fix updateUserTotalReceived() test case --- src/services/userService.test.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/services/userService.test.ts b/src/services/userService.test.ts index 68111c5e1..2be41fd34 100644 --- a/src/services/userService.test.ts +++ b/src/services/userService.test.ts @@ -113,13 +113,13 @@ function updateUserTotalReceivedTestCases() { ...createProjectData(), admin: String(user.id), organizationLabel: ORGANIZATION_LABELS.GIVING_BLOCK, - totalDonations: 180, + totalDonations: 0, }); const project2 = await saveProjectDirectlyToDb({ ...createProjectData(), admin: String(user.id), organizationLabel: ORGANIZATION_LABELS.GIVING_BLOCK, - totalDonations: 190, + totalDonations: 0, }); const qfRound = QfRound.create({ isActive: false, @@ -149,11 +149,12 @@ function updateUserTotalReceivedTestCases() { await owner?.save(); await updateTotalDonationsOfProject(project.id); + await updateTotalDonationsOfProject(project2.id); await updateUserTotalReceived(user.id); const updatedOwner = await findUserById(user.id); assert.notEqual(owner!.totalReceived, updatedOwner!.totalReceived); - assert.equal(updatedOwner!.totalReceived, 180 + 190 + 150 + 160); + assert.equal(updatedOwner!.totalReceived, 150 + 160); }); }