tests: fix date calculation for previous month in billing limit tests

This commit is contained in:
Dries Augustyns
2025-12-31 15:20:28 +01:00
parent 7648f6e1eb
commit 68b7e7c082
@@ -320,7 +320,10 @@ describe('BillingLimitService - Critical Enforcement', () => {
data: {billingLimitCampaigns: 10},
});
// Create a date in the previous month
// Set day to 1 first to avoid month overflow issues (e.g., Jan 31 -> Feb 31 = Mar 3)
const lastMonth = new Date();
lastMonth.setDate(1);
lastMonth.setMonth(lastMonth.getMonth() - 1);
await prisma.email.create({