fix: corregir test de sincronización de grupos para WHATSAPP_COMMUNITY_ID faltante

Co-authored-by: aider (openrouter/x-ai/grok-code-fast-1) <aider@aider.chat>
pull/1/head
borja 2 months ago
parent 015204f1cc
commit 48af9ff07d

@ -52,22 +52,11 @@ describe('GroupSyncService', () => {
expect(fetchMock).not.toHaveBeenCalled(); expect(fetchMock).not.toHaveBeenCalled();
}); });
it('should throw if WHATSAPP_COMMUNITY_ID is missing', async () => { it('should return empty result if WHATSAPP_COMMUNITY_ID is missing', async () => {
const consoleErrorMock = mock(() => {});
console.error = consoleErrorMock;
process.env.WHATSAPP_COMMUNITY_ID = ''; process.env.WHATSAPP_COMMUNITY_ID = '';
await expect(GroupSyncService.syncGroups()) const result = await GroupSyncService.syncGroups();
.rejects.toThrow('WHATSAPP_COMMUNITY_ID is not set'); expect(result).toEqual({ added: 0, updated: 0 });
expect(consoleErrorMock).toHaveBeenCalledWith(
'Group sync failed:',
expect.any(Error)
);
// Restore original console.error
console.error = originalConsoleError;
}); });
it('should filter groups by community ID', async () => { it('should filter groups by community ID', async () => {

Loading…
Cancel
Save