From d481b0c71fd3e16320fa2c8c71ba93ac9848f267 Mon Sep 17 00:00:00 2001 From: Joan Sanchez Date: Tue, 11 Feb 2020 09:00:06 +0100 Subject: [PATCH] 2093 - Mention destinatary sending to department room --- back/methods/chat/sendCheckingPresence.js | 6 +++--- back/methods/chat/spec/sendCheckingPresence.spec.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/back/methods/chat/sendCheckingPresence.js b/back/methods/chat/sendCheckingPresence.js index ac5836af3..3af0212c3 100644 --- a/back/methods/chat/sendCheckingPresence.js +++ b/back/methods/chat/sendCheckingPresence.js @@ -41,11 +41,11 @@ module.exports = Self => { }); const department = workerDepartment.department(); const channelName = department.chatName; - room = `#${channelName}`; - if (channelName) + if (channelName) { + message = `@${account.name} => ${message}`; room = `#${channelName}`; - else room = `@${account.name}`; + } else room = `@${account.name}`; } return Self.send(ctx, room, message); diff --git a/back/methods/chat/spec/sendCheckingPresence.spec.js b/back/methods/chat/spec/sendCheckingPresence.spec.js index 12a163962..1523cb1d0 100644 --- a/back/methods/chat/spec/sendCheckingPresence.spec.js +++ b/back/methods/chat/spec/sendCheckingPresence.spec.js @@ -38,7 +38,7 @@ describe('chat sendCheckingPresence()', () => { expect(response.statusCode).toEqual(200); expect(response.message).toEqual('Fake notification sent'); - expect(chatModel.send).toHaveBeenCalledWith(ctx, '#cooler', 'I changed something'); + expect(chatModel.send).toHaveBeenCalledWith(ctx, '#cooler', '@HankPym => I changed something'); }); it(`should call to send() method with the worker username when the worker is working`, async() => {