feat(admin-images) : add standalone export generators
This commit is contained in:
@@ -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 > 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" },
|
||||
|
||||
Reference in New Issue
Block a user