mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-06-14 16:42:35 +02:00
fix #859 and update tests to match
This commit is contained in:
parent
76eea7bdfd
commit
782c943f93
2 changed files with 4 additions and 4 deletions
|
@ -14,7 +14,7 @@ class DingDing extends NotificationProvider {
|
||||||
msgtype: "markdown",
|
msgtype: "markdown",
|
||||||
markdown: {
|
markdown: {
|
||||||
title: monitorJSON["name"],
|
title: monitorJSON["name"],
|
||||||
text: `## [${this.statusToString(heartbeatJSON["status"])}] \n > ${heartbeatJSON["msg"]} \n > Time(UTC):${heartbeatJSON["time"]}`,
|
text: `## [${this.statusToString(heartbeatJSON["status"])}] ${monitorJSON["name"]}\n > ${heartbeatJSON["msg"]} \n > Time(UTC):${heartbeatJSON["time"]}`,
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
if (await this.sendToDingDing(notification, params)) {
|
if (await this.sendToDingDing(notification, params)) {
|
||||||
|
|
|
@ -53,7 +53,7 @@ describe("notification to act properly on send", () => {
|
||||||
let res = await notif.send(notificationConf, msg, monitorConf, heartbeatConf);
|
let res = await notif.send(notificationConf, msg, monitorConf, heartbeatConf);
|
||||||
|
|
||||||
expect(axios).toHaveBeenCalledWith({
|
expect(axios).toHaveBeenCalledWith({
|
||||||
data: "{\"msgtype\":\"markdown\",\"markdown\":{\"title\":\"testing\",\"text\":\"## [UP] \\n > some message \\n > Time(UTC):example time\"}}",
|
data: "{\"msgtype\":\"markdown\",\"markdown\":{\"title\":\"testing\",\"text\":\"## [UP] testing\\n > some message \\n > Time(UTC):example time\"}}",
|
||||||
headers: {
|
headers: {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
},
|
},
|
||||||
|
@ -146,7 +146,7 @@ describe("notification to act properly on error", () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
expect(axios).toHaveBeenCalledWith({
|
expect(axios).toHaveBeenCalledWith({
|
||||||
data: "{\"msgtype\":\"markdown\",\"markdown\":{\"title\":\"testing\",\"text\":\"## [UP] \\n > some message \\n > Time(UTC):example time\"}}",
|
data: "{\"msgtype\":\"markdown\",\"markdown\":{\"title\":\"testing\",\"text\":\"## [UP] testing\\n > some message \\n > Time(UTC):example time\"}}",
|
||||||
headers: {
|
headers: {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
},
|
},
|
||||||
|
@ -194,7 +194,7 @@ describe("notification to get proper data from Notification.send", () => {
|
||||||
expect(res).toBe("Sent Successfully.");
|
expect(res).toBe("Sent Successfully.");
|
||||||
|
|
||||||
expect(axios).toHaveBeenCalledWith({
|
expect(axios).toHaveBeenCalledWith({
|
||||||
data: "{\"msgtype\":\"markdown\",\"markdown\":{\"title\":\"testing\",\"text\":\"## [UP] \\n > some message \\n > Time(UTC):example time\"}}",
|
data: "{\"msgtype\":\"markdown\",\"markdown\":{\"title\":\"testing\",\"text\":\"## [UP] testing\\n > some message \\n > Time(UTC):example time\"}}",
|
||||||
headers: {
|
headers: {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Reference in a new issue