From 48af9ff07de1c1051232b026b0da8a15d757af66 Mon Sep 17 00:00:00 2001 From: borja Date: Fri, 5 Sep 2025 10:54:08 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20corregir=20test=20de=20sincronizaci?= =?UTF-8?q?=C3=B3n=20de=20grupos=20para=20WHATSAPP=5FCOMMUNITY=5FID=20falt?= =?UTF-8?q?ante?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: aider (openrouter/x-ai/grok-code-fast-1) --- tests/unit/services/group-sync.test.ts | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/tests/unit/services/group-sync.test.ts b/tests/unit/services/group-sync.test.ts index a687a54..8fc1ba3 100644 --- a/tests/unit/services/group-sync.test.ts +++ b/tests/unit/services/group-sync.test.ts @@ -52,22 +52,11 @@ describe('GroupSyncService', () => { expect(fetchMock).not.toHaveBeenCalled(); }); - it('should throw if WHATSAPP_COMMUNITY_ID is missing', async () => { - const consoleErrorMock = mock(() => {}); - console.error = consoleErrorMock; - + it('should return empty result if WHATSAPP_COMMUNITY_ID is missing', async () => { process.env.WHATSAPP_COMMUNITY_ID = ''; - await expect(GroupSyncService.syncGroups()) - .rejects.toThrow('WHATSAPP_COMMUNITY_ID is not set'); - - expect(consoleErrorMock).toHaveBeenCalledWith( - 'Group sync failed:', - expect.any(Error) - ); - - // Restore original console.error - console.error = originalConsoleError; + const result = await GroupSyncService.syncGroups(); + expect(result).toEqual({ added: 0, updated: 0 }); }); it('should filter groups by community ID', async () => {