diff --git a/plugins/notifications-backend-module-slack/src/lib/SlackNotificationProcessor.test.ts b/plugins/notifications-backend-module-slack/src/lib/SlackNotificationProcessor.test.ts index c970aec7ba..ad4bf01e9f 100644 --- a/plugins/notifications-backend-module-slack/src/lib/SlackNotificationProcessor.test.ts +++ b/plugins/notifications-backend-module-slack/src/lib/SlackNotificationProcessor.test.ts @@ -829,7 +829,7 @@ describe('SlackNotificationProcessor', () => { const calls = (slack.chat.postMessage as jest.Mock).mock.calls; expect(calls).toHaveLength(1); - expect(calls[0][0]).not.toHaveProperty('username'); + expect(calls[0][0].username).toBeUndefined(); }); }); diff --git a/plugins/notifications-backend-module-slack/src/lib/util.ts b/plugins/notifications-backend-module-slack/src/lib/util.ts index 1116218b09..33293ea24f 100644 --- a/plugins/notifications-backend-module-slack/src/lib/util.ts +++ b/plugins/notifications-backend-module-slack/src/lib/util.ts @@ -30,7 +30,7 @@ export function toChatPostMessageArgs(options: { const args: ChatPostMessageArguments = { channel, text: payload.title, - ...(username && { username }), + username, attachments: [ { color: getColor(payload.severity),