fix(push): render created tags/branches as create events instead of 0 commits

This commit is contained in:
RhenCloud 2026-08-29 16:45:17 +08:00
parent 5c31b573d3
commit cc8bb4182f
No known key found for this signature in database
GPG key ID: A574A617378C4E0B
4 changed files with 36 additions and 2 deletions

View file

@ -459,7 +459,7 @@ describe("limits and localization", () => {
expect(msg.description).toBe(`${link} ${"x".repeat(MAX_COMMIT_SUBJECT)}`);
});
it("tag push created mentions the tag", () => {
it("tag push created renders as a tag creation", () => {
const msg = formatEvent(
route,
event("push", {
@ -472,7 +472,11 @@ describe("limits and localization", () => {
sender,
}),
);
expect(msg.description).toBe("🆕 Tag created");
expect(msg.title).toBe(
"acme/widget: 🏷️ Created tag [`v1.0`](https://github.com/acme/widget/releases/tag/v1.0)",
);
expect(msg.color).toBe(4176208);
expect(msg.description).toBeUndefined();
});
it("commit_comment without a commit id omits the sha", () => {