diff --git a/back/methods/chat/send.js b/back/methods/chat/send.js index b0a9431c7..53e5da7cc 100644 --- a/back/methods/chat/send.js +++ b/back/methods/chat/send.js @@ -32,6 +32,8 @@ module.exports = Self => { if (sender.name != recipient) return sendMessage(sender, to, message); + + return false; }; async function sendMessage(sender, channel, message) { diff --git a/back/methods/chat/spec/send.spec.js b/back/methods/chat/spec/send.spec.js index b2585a9a1..56f2a9c27 100644 --- a/back/methods/chat/spec/send.spec.js +++ b/back/methods/chat/spec/send.spec.js @@ -9,10 +9,10 @@ describe('chat send()', () => { expect(response.message).toEqual('Fake notification sent'); }); - it('should not return a response', async() => { + it('should retrun false as response', async() => { let ctx = {req: {accessToken: {userId: 18}}}; let response = await app.models.Chat.send(ctx, '@salesPerson', 'I changed something'); - expect(response).toBeUndefined(); + expect(response).toBeFalsy(); }); });