fix(formatter): link branch and tag titles

This commit is contained in:
RhenCloud committed 2026-10-01 18:40:02 +08:00
1 parent b7fd31a665
commit 3567c6d321
7 files changed
+45 -8

No files matched your search

+10
View File
@@ -100,6 +100,16 @@ describe("discord role mentions", () => {
icon_url: "https://github.com/fluidicon.png",
});
});
it("links the repository heading for a tag title", () => {
const out = renderNeutralMessage({
title: "acme/widget: 🏷️ Created tag v1.0",
url: "https://github.com/acme/widget/releases/tag/v1.0",
});
expect(out.embeds?.[0]?.title).toBe("acme/widget");
expect(out.embeds?.[0]?.url).toBe("https://github.com/acme/widget/releases/tag/v1.0");
expect(out.embeds?.[0]?.description).toBe("🏷️ Created tag v1.0");
});
});
describe("dispatchEvent fallback routing", () => {
+6 -2
View File
@@ -491,7 +491,10 @@ describe("group emoji toggle", () => {
}),
);
expect(msg.title).toBe(
"acme/widget: 🌿 Deleted branch [`dependabot/npm_and_yarn/multi-e1b34b8be3`](https://github.com/acme/widget/tree/dependabot/npm_and_yarn/multi-e1b34b8be3)",
"acme/widget: 🌿 Deleted branch dependabot/npm_and_yarn/multi-e1b34b8be3",
);
expect(msg.url).toBe(
"https://github.com/acme/widget/tree/dependabot/npm_and_yarn/multi-e1b34b8be3",
);
expect(msg.description).toBeUndefined();
expect(msg.fields).toBeUndefined();
@@ -630,8 +633,9 @@ describe("limits and localization", () => {
}),
);
expect(msg.title).toBe(
"acme/widget: 🏷️ Created tag [`v1.0`](https://github.com/acme/widget/releases/tag/v1.0)",
"acme/widget: 🏷️ Created tag v1.0",
);
expect(msg.url).toBe("https://github.com/acme/widget/releases/tag/v1.0");
expect(msg.color).toBe(4176208);
expect(msg.description).toBeUndefined();
});