2093 - Mention destinatary sending to department room

This commit is contained in:
Joan Sanchez 2020-02-11 09:00:06 +01:00
parent 375807dec4
commit d481b0c71f
2 changed files with 4 additions and 4 deletions

View File

@ -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);

View File

@ -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() => {