feat: update
CI / Verify (push) Successful in 55s
CI / Build immutable images and deploy (push) Successful in 1m13s

This commit is contained in:
2026-09-01 16:31:05 +07:00 Unverified
parent 8fa651684f
commit 1d19961d8b
11 changed files with 113 additions and 91 deletions
+11 -11
View File
@@ -3,19 +3,19 @@ import { describe, expect, it } from "vitest";
import { elementBackgroundColor } from "@/lib/catalog/element";
describe("catalog element backgrounds", () => {
it("maps every character element to its 40% opacity color", () => {
expect(elementBackgroundColor("Pyro")).toBe("#12000066");
expect(elementBackgroundColor("Hydro")).toBe("#00051266");
expect(elementBackgroundColor("Anemo")).toBe("#06141566");
expect(elementBackgroundColor("Electro")).toBe("#0D000F66");
expect(elementBackgroundColor("Dendro")).toBe("#000F0466");
expect(elementBackgroundColor("Cryo")).toBe("#03202166");
expect(elementBackgroundColor("Geo")).toBe("#0F0D0066");
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("#17383d66");
expect(elementBackgroundColor(undefined)).toBe("#17383d66");
expect(elementBackgroundColor("Unknown")).toBe("#17383d66");
expect(elementBackgroundColor(null)).toBe("#17383d");
expect(elementBackgroundColor(undefined)).toBe("#17383d");
expect(elementBackgroundColor("Unknown")).toBe("#17383d");
});
});