From 76eea7bdfdcb5387f29301203cfb4570f56fb11a Mon Sep 17 00:00:00 2001 From: Jeffrey Koehler Date: Mon, 25 Oct 2021 23:49:27 -0500 Subject: [PATCH] NotificationProvider tests --- .../notification-provider.spec.js | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/server/notification-providers/notification-provider.spec.js b/server/notification-providers/notification-provider.spec.js index 56d929b..1f6f037 100644 --- a/server/notification-providers/notification-provider.spec.js +++ b/server/notification-providers/notification-provider.spec.js @@ -16,3 +16,25 @@ describe("notification default information", () => { expect(notification.name).toBe(undefined); }); }); + +describe("notification to error if blank notification called", () => { + it("should respond with an error if just called.", async () => { + + let notif = new NotificationProvider(); + let notificationConf = { + type: "telegram", + telegramBotToken: "abc", + telegramChatID: "123", + }; + let msg = "PassedInMessage😀"; + + try { + await notif.send(notificationConf, msg, null, null); + expect("Error thrown").toBe(false); + } catch (e) { + expect(e.message).toBe("Have to override Notification.send(...)"); + } + + }); + +});