mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-06-12 15:42:35 +02:00
NotificationProvider tests
This commit is contained in:
parent
c86e80d1b9
commit
76eea7bdfd
1 changed files with 22 additions and 0 deletions
|
@ -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(...)");
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue