fix: strip markup heartbeat acks
This commit is contained in:
@@ -90,4 +90,36 @@ describe("stripHeartbeatToken", () => {
|
||||
didStrip: false,
|
||||
});
|
||||
});
|
||||
|
||||
it("strips HTML-wrapped heartbeat tokens", () => {
|
||||
expect(
|
||||
stripHeartbeatToken(`<b>${HEARTBEAT_TOKEN}</b>`, { mode: "heartbeat" }),
|
||||
).toEqual({
|
||||
shouldSkip: true,
|
||||
text: "",
|
||||
didStrip: true,
|
||||
});
|
||||
});
|
||||
|
||||
it("strips markdown-wrapped heartbeat tokens", () => {
|
||||
expect(
|
||||
stripHeartbeatToken(`**${HEARTBEAT_TOKEN}**`, { mode: "heartbeat" }),
|
||||
).toEqual({
|
||||
shouldSkip: true,
|
||||
text: "",
|
||||
didStrip: true,
|
||||
});
|
||||
});
|
||||
|
||||
it("removes markup-wrapped token and keeps trailing content", () => {
|
||||
expect(
|
||||
stripHeartbeatToken(`<code>${HEARTBEAT_TOKEN}</code> all good`, {
|
||||
mode: "message",
|
||||
}),
|
||||
).toEqual({
|
||||
shouldSkip: false,
|
||||
text: "all good",
|
||||
didStrip: true,
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user