feat : update
CI / Verify (push) Successful in 1m5s
CI / Build immutable images and deploy (push) Successful in 1m56s

This commit is contained in:
2026-09-03 19:15:10 +07:00 Unverified
parent 381ee216dd
commit 1b014d7c8f
8 changed files with 226 additions and 704 deletions
+1 -16
View File
@@ -1,23 +1,8 @@
import { describe, expect, it } from "vitest";
import {
constellationChartRows,
imageContentDisposition,
} from "@/lib/guides/export-image";
import { constellationChartRows } from "@/lib/guides/export-image";
describe("guide image downloads", () => {
it("provides a safe ASCII fallback and a UTF-8 filename", () => {
expect(imageContentDisposition("ไกด์อาวุธ", "weapons")).toBe(
"attachment; filename=\"weapons.png\"; filename*=UTF-8''%E0%B9%84%E0%B8%81%E0%B8%94%E0%B9%8C%E0%B8%AD%E0%B8%B2%E0%B8%A7%E0%B8%B8%E0%B8%98.png",
);
});
it("sanitizes punctuation in the fallback filename", () => {
expect(imageContentDisposition("Arlecchino / R5", "weapons")).toContain(
'filename="Arlecchino-R5.png"',
);
});
it("orders constellation levels, adds C0, and scales against the maximum", () => {
const rows = constellationChartRows([
{ level: 1, cumulativePercent: "117", isGreat: false },