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