From 7e54fc33ae7546f03e77ac21c82a5b3c5c4da16b Mon Sep 17 00:00:00 2001 From: Simon Larsen Date: Wed, 14 Aug 2024 10:11:08 +0100 Subject: [PATCH] refactor: Update ProjectTestService to allow generating random projects with seat limit --- .../Server/TestingUtils/Services/ProjectServiceHelper.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Common/Tests/Server/TestingUtils/Services/ProjectServiceHelper.ts b/Common/Tests/Server/TestingUtils/Services/ProjectServiceHelper.ts index d255a79091..5e9c708136 100644 --- a/Common/Tests/Server/TestingUtils/Services/ProjectServiceHelper.ts +++ b/Common/Tests/Server/TestingUtils/Services/ProjectServiceHelper.ts @@ -3,7 +3,7 @@ import Project from "Common/Models/DatabaseModels/Project"; import { PlanType } from "../../../../Types/Billing/SubscriptionPlan"; export default class ProjectTestService { - public static generateRandomProject(data: { seatLimit?: number }): Project { + public static generateRandomProject(data?: { seatLimit?: number } | undefined): Project { const project: Project = new Project(); // required fields @@ -11,6 +11,11 @@ export default class ProjectTestService { project.slug = project.name; project.isBlocked = false; project.requireSsoForLogin = false; + + if(data && data.seatLimit){ + project.seatLimit = data.seatLimit; + } + project.smsOrCallCurrentBalanceInUSDCents = 0; project.autoRechargeSmsOrCallByBalanceInUSD = 0; project.autoRechargeSmsOrCallWhenCurrentBalanceFallsInUSD = 0;