22 lines
950 B
TypeScript
22 lines
950 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 opaque background color", () => {
|
|
expect(elementBackgroundColor("Pyro")).toBe("#120000");
|
|
expect(elementBackgroundColor("Hydro")).toBe("#000512");
|
|
expect(elementBackgroundColor("Anemo")).toBe("#061415");
|
|
expect(elementBackgroundColor("Electro")).toBe("#0D000F");
|
|
expect(elementBackgroundColor("Dendro")).toBe("#000F04");
|
|
expect(elementBackgroundColor("Cryo")).toBe("#032021");
|
|
expect(elementBackgroundColor("Geo")).toBe("#0F0D00");
|
|
});
|
|
|
|
it("uses the neutral character background when the element is unavailable", () => {
|
|
expect(elementBackgroundColor(null)).toBe("#17383d");
|
|
expect(elementBackgroundColor(undefined)).toBe("#17383d");
|
|
expect(elementBackgroundColor("Unknown")).toBe("#17383d");
|
|
});
|
|
});
|