Files
buzz-sheet/lib/catalog/element.test.ts
T
gunshiz c9ca59e836
CI / Verify (push) Successful in 59s
CI / Build immutable images and deploy (push) Successful in 1m13s
Tune team element backgrounds and badges
2026-09-01 15:17:43 +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 80% opacity color", () => {
expect(elementBackgroundColor("Pyro")).toBe("#EF7938CC");
expect(elementBackgroundColor("Hydro")).toBe("#4CC2F1CC");
expect(elementBackgroundColor("Anemo")).toBe("#74C2A8CC");
expect(elementBackgroundColor("Electro")).toBe("#AF8EC1CC");
expect(elementBackgroundColor("Dendro")).toBe("#A5C83BCC");
expect(elementBackgroundColor("Cryo")).toBe("#9FD6E3CC");
expect(elementBackgroundColor("Geo")).toBe("#FAB632CC");
});
it("uses the neutral character background when the element is unavailable", () => {
expect(elementBackgroundColor(null)).toBe("#17383dcc");
expect(elementBackgroundColor(undefined)).toBe("#17383dcc");
expect(elementBackgroundColor("Unknown")).toBe("#17383dcc");
});
});