2093 - Mention destinatary sending to department room
gitea/salix/2093-chat_mention_destinatary There was a failure building this commit Details

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

View File

@ -41,11 +41,11 @@ module.exports = Self => {
}); });
const department = workerDepartment.department(); const department = workerDepartment.department();
const channelName = department.chatName; const channelName = department.chatName;
room = `#${channelName}`;
if (channelName) if (channelName) {
message = `@${account.name} => ${message}`;
room = `#${channelName}`; room = `#${channelName}`;
else room = `@${account.name}`; } else room = `@${account.name}`;
} }
return Self.send(ctx, room, message); return Self.send(ctx, room, message);

View File

@ -38,7 +38,7 @@ describe('chat sendCheckingPresence()', () => {
expect(response.statusCode).toEqual(200); expect(response.statusCode).toEqual(200);
expect(response.message).toEqual('Fake notification sent'); 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() => { it(`should call to send() method with the worker username when the worker is working`, async() => {