fix(push): link commit hash and render message as plain text

This commit is contained in:
RhenCloud 2026-08-11 17:50:20 +08:00
parent e1b1daac98
commit 52d136c468
7 changed files with 1249 additions and 1175 deletions

View file

@ -54,6 +54,16 @@ describe("telegram renderNeutralMessage", () => {
expect(out).toContain("<b>Status</b>: <b>ok</b> and <code>done</code>");
});
it("renders a code-formatted commit hash inside a link", () => {
const out = renderNeutralMessage({
title: "acme/widget: Pushed 1 commit",
fields: [{ name: "\u200b", value: "[`abcd123`](https://github.com/acme/widget/commit/abcd1234ef) fix stuff" }],
});
expect(out).toContain(
'<a href="https://github.com/acme/widget/commit/abcd1234ef"><code>abcd123</code></a> fix stuff',
);
});
it("formats ISO timestamps into a readable UTC string", () => {
const out = renderNeutralMessage({
title: "acme/widget: t",