Files
buzz-sheet/lib/catalog/element.test.ts
T
gunshiz 094b61ff32
CI / Verify (push) Successful in 1m12s
CI / Build immutable images and deploy (push) Successful in 1m12s
Darken team element backgrounds
2026-09-01 15:21:51 +07:00

22 lines
964 B
TypeScript

import { describe, expect, it } from "vitest";
import { elementBackgroundColor } from "@/lib/catalog/element";
describe("catalog element backgrounds", () => {
it("maps every character element to its 20% opacity color", () => {
expect(elementBackgroundColor("Pyro")).toBe("#12000033");
expect(elementBackgroundColor("Hydro")).toBe("#00051233");
expect(elementBackgroundColor("Anemo")).toBe("#06141533");
expect(elementBackgroundColor("Electro")).toBe("#0D000F33");
expect(elementBackgroundColor("Dendro")).toBe("#000F0433");
expect(elementBackgroundColor("Cryo")).toBe("#03202133");
expect(elementBackgroundColor("Geo")).toBe("#0F0D0033");
});
it("uses the neutral character background when the element is unavailable", () => {
expect(elementBackgroundColor(null)).toBe("#17383d33");
expect(elementBackgroundColor(undefined)).toBe("#17383d33");
expect(elementBackgroundColor("Unknown")).toBe("#17383d33");
});
});