feat(admin-images) : add standalone export generators
CI / Verify (push) Successful in 1m29s
CI / Build immutable images and deploy (push) Failing after 1m42s

This commit is contained in:
2026-09-29 17:13:24 +07:00 Unverified
parent 76478fe56d
commit db554228bc
21 changed files with 1179 additions and 64 deletions
+35
View File
@@ -0,0 +1,35 @@
import { renderToStaticMarkup } from "react-dom/server";
import { describe, expect, it } from "vitest";
import { ConstellationImageGenerator } from "@/components/admin/constellation-image-generator";
import { TeamImageGenerator } from "@/components/admin/team-image-generator";
import { WeaponImageGenerator } from "@/components/admin/weapon-image-generator";
describe("admin image generator empty states", () => {
it("starts Team with a create action instead of an empty form", () => {
const html = renderToStaticMarkup(
<TeamImageGenerator characters={[]} weapons={[]} artifacts={[]} />,
);
expect(html).toContain("ยังไม่มี Team");
expect(html).toContain("เพิ่ม Team");
expect(html).not.toContain("team-image-title");
});
it("starts Weapon with a create action instead of an empty row", () => {
const html = renderToStaticMarkup(
<WeaponImageGenerator characters={[]} weapons={[]} />,
);
expect(html).toContain("ยังไม่มีรายการอาวุธ");
expect(html).toContain("เพิ่มรายการอาวุธ");
expect(html).not.toContain("weapon-image-condition");
});
it("starts Constellation with one action that creates C1–C6", () => {
const html = renderToStaticMarkup(
<ConstellationImageGenerator characters={[]} />,
);
expect(html).toContain("ยังไม่มี Constellation");
expect(html).toContain("สร้าง Constellation");
expect(html).not.toContain("constellation-image-c1");
});
});