import { describe, expect, test } from "bun:test";
import { reactorsLabel } from "./reactions";
describe("reactorsLabel", () => {
test("lists everyone when few reacted", () => {
expect(reactorsLabel(["alice"], 1)).toBe("alice");
expect(reactorsLabel(["alice", "bob", "carol"], 3)).toBe("alice, bob and carol");
});
test("caps the names and summarizes the rest of a huge count", () => {
const names = ["a", "b", "c", "d", "e", "f"];
expect(reactorsLabel(names, 50_000)).toBe("a, b, c, d, e and 49,995 others");
expect(reactorsLabel(["a"], 2)).toBe("a and 1 other");
});
});