import { describe, expect, test } from "bun:test"; import { normalizeRole } from "../../src/lib/collections.ts"; describe("normalizeRole", () => { test("passes through valid roles", () => { expect(normalizeRole("admin")).toBe("admin"); expect(normalizeRole("contributor")).toBe("contributor"); expect(normalizeRole("viewer")).toBe("viewer"); }); test("defaults to contributor for invalid or missing input", () => { expect(normalizeRole(null)).toBe("contributor"); expect(normalizeRole(undefined)).toBe("contributor"); expect(normalizeRole("")).toBe("contributor"); expect(normalizeRole("superadmin")).toBe("contributor"); expect(normalizeRole("ADMIN")).toBe("contributor"); expect(normalizeRole("