|
|
|
@ -79,14 +79,14 @@ describe('CommandService - parser de fechas (hoy/mañana y formatos YYYY/YY-MM-D
|
|
|
|
const ctx = {
|
|
|
|
const ctx = {
|
|
|
|
sender,
|
|
|
|
sender,
|
|
|
|
groupId: `${sender}@s.whatsapp.net`,
|
|
|
|
groupId: `${sender}@s.whatsapp.net`,
|
|
|
|
message: '/t n con corto 25-12-19',
|
|
|
|
message: '/t n con corto 28-12-19',
|
|
|
|
mentions: [] as string[],
|
|
|
|
mentions: [] as string[],
|
|
|
|
};
|
|
|
|
};
|
|
|
|
await CommandService.handle(ctx);
|
|
|
|
await CommandService.handle(ctx);
|
|
|
|
|
|
|
|
|
|
|
|
const row = memdb.prepare(`SELECT id, due_date FROM tasks ORDER BY id DESC LIMIT 1`).get() as any;
|
|
|
|
const row = memdb.prepare(`SELECT id, due_date FROM tasks ORDER BY id DESC LIMIT 1`).get() as any;
|
|
|
|
expect(row).toBeTruthy();
|
|
|
|
expect(row).toBeTruthy();
|
|
|
|
expect(String(row.due_date)).toBe('2025-12-19');
|
|
|
|
expect(String(row.due_date)).toBe('2028-12-19');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
it('acepta formato YY-MM-DD con ceros y futuro lejano seguro (30-01-05 → 2030-01-05)', async () => {
|
|
|
|
it('acepta formato YY-MM-DD con ceros y futuro lejano seguro (30-01-05 → 2030-01-05)', async () => {
|
|
|
|
|