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
+44
View File
@@ -10,9 +10,53 @@ import {
import { MaterialPoster } from "@/components/public/material-poster";
import { ConstellationImage } from "@/components/public/constellation-image";
import { WeaponComparisonImage } from "@/components/public/weapon-image-export";
import { TeamExportImage, type TeamExportData } from "@/components/public/team-search";
import type { PublicGuide } from "@/lib/guides/queries";
describe("image export controls", () => {
it.each([1, 4])("renders the shared Team Calc image with %i member(s)", (memberCount) => {
const members: TeamExportData["members"] = Array.from({ length: memberCount }, (_, position) => ({
position,
constellation: String(position),
refinement: "1",
damage: "1000",
character: {
key: `character-${position}`,
name: `Character ${position + 1}`,
imageUrl: "/character.png",
element: "Fire",
rarity: 5,
},
weapon: {
key: `weapon-${position}`,
name: `Weapon ${position + 1}`,
imageUrl: "/weapon.png",
rarity: 5,
},
artifact: {
key: `artifact-${position}`,
name: `Artifact ${position + 1}`,
imageUrl: "/artifact.png",
rarity: 5,
},
secondArtifact: null,
}));
const team: TeamExportData = {
title: "Generator Team",
rotationSeconds: "20",
combo: "E > Q",
members,
};
const html = renderToStaticMarkup(<TeamExportImage team={team} />);
expect(html).toContain("Generator Team");
expect(html).toContain("Rotation duration: 20 seconds");
expect(html).toContain("E &gt; Q");
expect(html).toContain(`DPS: ${memberCount * 50}`);
expect(html.match(/Character \d/gu)).toHaveLength(memberCount);
});
it("omits the placeholder condition from weapon export images", () => {
const guide = {
character: { name: "Raiden", splashImageUrl: "/splash.png" },