|
|
|
|
@ -26,6 +26,9 @@ beforeEach(() => {
|
|
|
|
|
mockAdd = mock(() => Promise.resolve());
|
|
|
|
|
ResponseQueue.add = mockAdd;
|
|
|
|
|
|
|
|
|
|
// Inject testDb for WebhookServer to use
|
|
|
|
|
WebhookServer.dbInstance = testDb;
|
|
|
|
|
|
|
|
|
|
// Ensure database is initialized (recreates tables if dropped)
|
|
|
|
|
initializeDatabase(testDb);
|
|
|
|
|
|
|
|
|
|
@ -373,9 +376,7 @@ describe('WebhookServer', () => {
|
|
|
|
|
remoteJid: 'group-id@g.us',
|
|
|
|
|
participant: 'sender-id@s.whatsapp.net'
|
|
|
|
|
},
|
|
|
|
|
message: {
|
|
|
|
|
conversation: `/tarea nueva Test task ${futureDate1} some text ${futureDate2}`
|
|
|
|
|
}
|
|
|
|
|
message: { conversation: `/tarea nueva Test task ${futureDate1} some text ${futureDate2}` }
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
@ -401,9 +402,7 @@ describe('WebhookServer', () => {
|
|
|
|
|
remoteJid: 'group-id@g.us',
|
|
|
|
|
participant: 'sender-id@s.whatsapp.net'
|
|
|
|
|
},
|
|
|
|
|
message: {
|
|
|
|
|
conversation: `/tarea nueva Test task ${pastDate} more text ${futureDate}`
|
|
|
|
|
}
|
|
|
|
|
message: { conversation: `/tarea nueva Test task ${pastDate} more text ${futureDate}` }
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
@ -429,9 +428,7 @@ describe('WebhookServer', () => {
|
|
|
|
|
remoteJid: 'group-id@g.us',
|
|
|
|
|
participant: 'sender-id@s.whatsapp.net'
|
|
|
|
|
},
|
|
|
|
|
message: {
|
|
|
|
|
conversation: `/tarea nueva Test task ${pastDate1} and ${pastDate2}`
|
|
|
|
|
}
|
|
|
|
|
message: { conversation: `/tarea nueva Test task ${pastDate1} and ${pastDate2}` }
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
@ -456,9 +453,7 @@ describe('WebhookServer', () => {
|
|
|
|
|
remoteJid: 'group-id@g.us',
|
|
|
|
|
participant: 'sender-id@s.whatsapp.net'
|
|
|
|
|
},
|
|
|
|
|
message: {
|
|
|
|
|
conversation: `/tarea nueva Test task 2023-13-01 (invalid) ${futureDate} 25/12/2023 (invalid)`
|
|
|
|
|
}
|
|
|
|
|
message: { conversation: `/tarea nueva Test task 2023-13-01 (invalid) ${futureDate} 25/12/2023 (invalid)` }
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|