|
|
|
@ -287,8 +287,17 @@ describe('WebhookServer', () => {
|
|
|
|
|
|
|
|
|
|
await WebhookServer.handleRequest(createTestRequest(payload));
|
|
|
|
|
|
|
|
|
|
// Verify the detection log
|
|
|
|
|
expect(consoleSpy).toHaveBeenCalledWith(
|
|
|
|
|
// Verify all log calls in order
|
|
|
|
|
expect(consoleSpy.mock.calls).toEqual([
|
|
|
|
|
[
|
|
|
|
|
'ℹ️ Incoming webhook request:',
|
|
|
|
|
expect.objectContaining({
|
|
|
|
|
method: 'POST',
|
|
|
|
|
path: '/',
|
|
|
|
|
time: expect.any(String)
|
|
|
|
|
})
|
|
|
|
|
],
|
|
|
|
|
[
|
|
|
|
|
'🔍 Detected /tarea command:',
|
|
|
|
|
expect.objectContaining({
|
|
|
|
|
timestamp: expect.any(String),
|
|
|
|
@ -296,10 +305,8 @@ describe('WebhookServer', () => {
|
|
|
|
|
group: 'group123@g.us',
|
|
|
|
|
rawMessage: '/tarea nueva Finish project @user2 2025-04-30'
|
|
|
|
|
})
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
// Verify the parsing log
|
|
|
|
|
expect(consoleSpy).toHaveBeenCalledWith(
|
|
|
|
|
],
|
|
|
|
|
[
|
|
|
|
|
'✅ Successfully parsed command:',
|
|
|
|
|
expect.objectContaining({
|
|
|
|
|
action: 'nueva',
|
|
|
|
@ -307,7 +314,8 @@ describe('WebhookServer', () => {
|
|
|
|
|
dueDate: '2025-04-30',
|
|
|
|
|
mentionCount: 1
|
|
|
|
|
})
|
|
|
|
|
);
|
|
|
|
|
]
|
|
|
|
|
]);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|