test #2402

Merged
pablone merged 8 commits from test into dev 2024-05-03 10:58:44 +00:00
1 changed files with 10 additions and 12 deletions
Showing only changes of commit 3ae192c761 - Show all commits

View File

@ -52,18 +52,16 @@ describe('Operator', () => {
}); });
it('should not sent notification when is already notified by another worker', async() => { it('should not sent notification when is already notified by another worker', async() => {
try { const {id} = await models.NotificationQueue.create({
await models.NotificationQueue.create({ authorFk: 2,
authorFk: 2, notificationFk: notificationName,
notificationFk: notificationName, params: JSON.stringify({'labelerId': labeler, 'sectorId': sectorId, 'workerId': 2}),
params: JSON.stringify({'labelerId': labeler, 'sectorId': sectorId, 'workerId': 2}), created: '2001-01-01 11:30:00',
created: '2001-01-01 12:30:00', status: sentStatus
status: sentStatus });
}); const notificationQueue = await updateOperatorAndFindNotification();
await models.Operator.updateAll({id: 1}, {labelerFk: labeler, sectorFk: sectorId});
} catch (e) { expect(notificationQueue.id).toEqual(id);
expect(e.message).toEqual('Previous notification sended with the same parameters');
}
}); });
it('should send a notification when the previous one has distinct params', async() => { it('should send a notification when the previous one has distinct params', async() => {