From 079e1879b32fa216d76e32f8ab011923fbe1e009 Mon Sep 17 00:00:00 2001 From: Dries Augustyns Date: Fri, 22 May 2026 20:20:45 +0200 Subject: [PATCH] test(SecurityService): update test case for complaint count thresholds to reflect new ceiling values --- apps/api/src/services/__tests__/SecurityService.test.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/apps/api/src/services/__tests__/SecurityService.test.ts b/apps/api/src/services/__tests__/SecurityService.test.ts index 6bd1542..5a9b99b 100644 --- a/apps/api/src/services/__tests__/SecurityService.test.ts +++ b/apps/api/src/services/__tests__/SecurityService.test.ts @@ -137,10 +137,9 @@ describe('SecurityService', () => { }); it('should NOT trigger on high absolute complaint count when rate is healthy', async () => { - // 20,000 emails, 50 complaints = 0.25% (above warning 0.075%, would have - // tripped old absolute ceiling). With rate-only enforcement and rate - // above warning but below critical, this is a warning, not a violation. - await createEmails(20000, {complainedCount: 50}); + // 100,000 emails, 30 complaints = 0.03% (at warning floor, below critical 0.15%) + // Old absolute ceiling (25 complaints in 7d critical) would have tripped. + await createEmails(100000, {complainedCount: 30}); const status = await SecurityService.getSecurityStatus(projectId); expect(status.shouldDisable).toBe(false);