diff --git a/back/methods/chat/spec/notifyIssue.spec.js b/back/methods/chat/spec/notifyIssue.spec.js index 19fbbbd56..e23c33859 100644 --- a/back/methods/chat/spec/notifyIssue.spec.js +++ b/back/methods/chat/spec/notifyIssue.spec.js @@ -8,7 +8,17 @@ describe('Chat notifyIssue()', () => { const chatModel = app.models.Chat; const departmentId = 31; - it(`should call to notifyIssue() method then return a response calling the send() method`, async() => { + it(`should not call to the send() method and neither return a response`, async() => { + spyOn(chatModel, 'send').and.callThrough(); + spyOn(chatModel, 'rawSql').and.returnValue([]); + + const response = await chatModel.notifyIssues(ctx); + + expect(chatModel.send).not.toHaveBeenCalled(); + expect(response).toBeUndefined(); + }); + + it(`should return a response calling the send() method`, async() => { spyOn(chatModel, 'send').and.callThrough(); spyOn(chatModel, 'rawSql').and.returnValue([{title: 'Issue title'}]);