Files
buzz-sheet/lib/image-generator-empty.test.tsx
gunshiz db554228bc
CI / Verify (push) Successful in 1m29s
CI / Build immutable images and deploy (push) Failing after 1m42s
feat(admin-images) : add standalone export generators
2026-09-29 17:13:24 +07:00

36 lines
1.5 KiB
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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");
});
});