feat : keep full quatily for overview and material img and hide codtion 1 when no codition
This commit is contained in:
@@ -8,9 +8,29 @@ import {
|
||||
} from "@/components/public/guide-image-export";
|
||||
import { MaterialPoster } from "@/components/public/material-poster";
|
||||
import { ConstellationImage } from "@/components/public/constellation-image";
|
||||
import { WeaponComparisonImage } from "@/components/public/weapon-image-export";
|
||||
import type { PublicGuide } from "@/lib/guides/queries";
|
||||
|
||||
describe("image export controls", () => {
|
||||
it("omits the placeholder condition from weapon export images", () => {
|
||||
const guide = {
|
||||
character: { name: "Raiden", splashImageUrl: "/splash.png" },
|
||||
coverUrl: "/cover.png",
|
||||
} as PublicGuide;
|
||||
const group = { rows: [], name: null, note: null } as unknown as PublicGuide["weaponGroups"][number];
|
||||
const html = renderToStaticMarkup(
|
||||
<WeaponComparisonImage
|
||||
guide={guide}
|
||||
group={group}
|
||||
metric="overallPercent"
|
||||
conditionLabel={group.name}
|
||||
/>,
|
||||
);
|
||||
|
||||
expect(html).not.toContain("Condition 1");
|
||||
expect(html).not.toContain("เงื่อนไข 1");
|
||||
});
|
||||
|
||||
it("always offers both export modes even without notes", () => {
|
||||
const html = renderToStaticMarkup(<GuideImageExport fileName="guide.png">No notes</GuideImageExport>);
|
||||
expect(html).toContain("ส่งออกภาพ");
|
||||
@@ -93,4 +113,21 @@ describe("material poster text", () => {
|
||||
expect(html).not.toContain("วัสดุ");
|
||||
expect(html).not.toContain("เลเวล 90");
|
||||
});
|
||||
|
||||
it("optimizes scale-aware character artwork and bleeding layers for export", () => {
|
||||
const characterArtUrl = "https://buzz-cdn.astrxl.dev/posters/raiden.png";
|
||||
const html = renderToStaticMarkup(
|
||||
<MaterialPoster
|
||||
{...props}
|
||||
characterArtUrl={characterArtUrl}
|
||||
artworkScale={200}
|
||||
bleeding={[{ id: "bleed", imageUrl: characterArtUrl, amount: 50, blendMode: "screen" }]}
|
||||
/>,
|
||||
);
|
||||
|
||||
expect(html).toContain("/_next/image?url=https%3A%2F%2Fbuzz-cdn.astrxl.dev%2Fposters%2Fraiden.png");
|
||||
expect(html).toContain("w=3840");
|
||||
expect(html).toContain('sizes="3200px"');
|
||||
expect(html).not.toContain(`src="${characterArtUrl}"`);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user