|
|
|
@ -123,4 +123,37 @@ describe('CommandService - autoasignación con "yo" / "@yo"', () => {
|
|
|
|
expect(assignees).toContain(sender);
|
|
|
|
expect(assignees).toContain(sender);
|
|
|
|
expect(String(t.description)).toBe('Mi tarea');
|
|
|
|
expect(String(t.description)).toBe('Mi tarea');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it('en grupo: "@yo," autoasigna y no incrementa métricas de fallo', async () => {
|
|
|
|
|
|
|
|
const sender = '600666777';
|
|
|
|
|
|
|
|
await CommandService.handle({
|
|
|
|
|
|
|
|
sender,
|
|
|
|
|
|
|
|
groupId: 'group2@g.us',
|
|
|
|
|
|
|
|
message: '/t n Revisar algo @yo,',
|
|
|
|
|
|
|
|
mentions: [],
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const t = getLastTask();
|
|
|
|
|
|
|
|
const assignees = getAssignees(Number(t.id));
|
|
|
|
|
|
|
|
expect(assignees).toContain(sender);
|
|
|
|
|
|
|
|
expect(String(t.description)).toBe('Revisar algo');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const prom = Metrics.render?.('prom') || '';
|
|
|
|
|
|
|
|
expect(prom).not.toContain('onboarding_assign_failures_total');
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it('en grupo: "(yo)" autoasigna y no queda en la descripción', async () => {
|
|
|
|
|
|
|
|
const sender = '600777888';
|
|
|
|
|
|
|
|
await CommandService.handle({
|
|
|
|
|
|
|
|
sender,
|
|
|
|
|
|
|
|
groupId: 'grp2@g.us',
|
|
|
|
|
|
|
|
message: '/t n Hacer (yo)',
|
|
|
|
|
|
|
|
mentions: [],
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const t = getLastTask();
|
|
|
|
|
|
|
|
const assignees = getAssignees(Number(t.id));
|
|
|
|
|
|
|
|
expect(assignees).toContain(sender);
|
|
|
|
|
|
|
|
expect(String(t.description)).toBe('Hacer');
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|