diff --git a/tests/unit/server.test.ts b/tests/unit/server.test.ts index 1fd695d..6120d5b 100644 --- a/tests/unit/server.test.ts +++ b/tests/unit/server.test.ts @@ -251,12 +251,18 @@ describe('WebhookServer', () => { await WebhookServer.handleRequest(createTestRequest(payload)); expect(consoleSpy).toHaveBeenCalledWith( - expect.stringContaining('/tarea command received:'), + '🔍 Detected /tarea command:', expect.objectContaining({ - command: '/tarea', - arguments: 'test', + rawMessage: '/tarea test' + }) + ); + expect(consoleSpy).toHaveBeenCalledWith( + '✅ Successfully parsed command:', + expect.objectContaining({ + action: 'test', + description: '', dueDate: 'none', - fullMessage: '/tarea test' + mentionCount: 0 }) ); }); @@ -277,10 +283,18 @@ describe('WebhookServer', () => { await WebhookServer.handleRequest(createTestRequest(payload)); expect(consoleSpy).toHaveBeenCalledWith( - expect.stringContaining('/tarea command received:'), + '🔍 Detected /tarea command:', + expect.objectContaining({ + rawMessage: '/tarea due:2025-04-30 Finish project' + }) + ); + expect(consoleSpy).toHaveBeenCalledWith( + '✅ Successfully parsed command:', expect.objectContaining({ + action: 'due:2025-04-30', + description: 'Finish project', dueDate: '2025-04-30', - arguments: 'due:2025-04-30 Finish project' + mentionCount: 0 }) ); });