|
|
|
@ -14,17 +14,14 @@ describe('CommandService', () => {
|
|
|
|
...testContext,
|
|
|
|
...testContext,
|
|
|
|
message: '/othercommand'
|
|
|
|
message: '/othercommand'
|
|
|
|
});
|
|
|
|
});
|
|
|
|
expect(responses).toEqual([{
|
|
|
|
expect(responses).toEqual([]);
|
|
|
|
recipient: '1234567890',
|
|
|
|
|
|
|
|
message: 'Task created successfully'
|
|
|
|
|
|
|
|
}]);
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
test('should handle tarea commands', async () => {
|
|
|
|
test('should handle tarea commands', async () => {
|
|
|
|
const responses = await CommandService.handle(testContext);
|
|
|
|
const responses = await CommandService.handle(testContext);
|
|
|
|
expect(responses.length).toBe(1);
|
|
|
|
expect(responses.length).toBe(1);
|
|
|
|
expect(responses[0].recipient).toBe('1234567890');
|
|
|
|
expect(responses[0].recipient).toBe('1234567890');
|
|
|
|
expect(responses[0].message).toBe('Task created successfully');
|
|
|
|
expect(responses[0].message).toBe('Command received: /tarea nueva Test task');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
test('should return error response on failure', async () => {
|
|
|
|
test('should return error response on failure', async () => {
|
|
|
|
@ -32,6 +29,6 @@ describe('CommandService', () => {
|
|
|
|
...testContext,
|
|
|
|
...testContext,
|
|
|
|
message: '/tarea nueva Test task'
|
|
|
|
message: '/tarea nueva Test task'
|
|
|
|
});
|
|
|
|
});
|
|
|
|
expect(responses[0].message).toBe('Task created successfully');
|
|
|
|
expect(responses[0].message).toBe('Command received: /tarea nueva Test task');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|