Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { describe, expect, it } from "vitest";
import { ReversalHealthCard } from "@/components/site/app-panels/reversal-health-card";
import {
formatRatePct,
formatReversalEventType,
reversalHealthStatus,
type ReversalHealth,
} from "@/components/site/app-panels/reversal-health-card-model";
Expand Down Expand Up @@ -87,3 +88,18 @@ describe("ReversalHealthCard", () => {
expect(screen.getByText("No reversals in window")).toBeTruthy();
});
});

describe("formatReversalEventType (#8665)", () => {
it("names a bot-merge revert (the reversal_reverted branch, the headline event this card surfaces)", () => {
expect(formatReversalEventType("reversal_reverted")).toBe("merge reverted");
});

it("names a close reopen (the reversal_reopened branch)", () => {
expect(formatReversalEventType("reversal_reopened")).toBe("close reopened");
});

it("humanizes any other event type by replacing underscores (the fallback branch)", () => {
expect(formatReversalEventType("some_other_event")).toBe("some other event");
expect(formatReversalEventType("plain")).toBe("plain");
});
});
Loading