feat(media): 可美 Seedream - 接入图片协议与尺寸能力

This commit is contained in:
ddcat666 committed 2026-10-10 04:51:22 +08:00
commit 21d6d8a0b9
24 files changed
+3275 -21

No files matched your search

+13
View File
@@ -17,6 +17,19 @@ describe("统一图片分辨率与宽高比", () => {
expect(imageQualityLabel("MAX")).toBe("最高");
});
test("Seedream 5.0 shows 1.5K and retains the exact official 2K wide size", () => {
const profile = defaultImageCapabilityConfig("km-kemei-seedream", "doubao-seedream-5-0-pro-260628");
const intermediate = renderToStaticMarkup(<ImageSizePicker profile={profile} size="1536x1536" onChange={() => {}} />);
expect(intermediate).toMatch(/aria-pressed="true"[^>]*>1\.5K/);
expect(intermediate).toContain("1536 × 1536 px");
expect(intermediate).not.toMatch(/<button[^>]*>4K/);
const wide = renderToStaticMarkup(<ImageSizePicker profile={profile} size="2816x1584" onChange={() => {}} />);
expect(wide).toMatch(/aria-pressed="true"[^>]*>2K/);
expect(wide).toContain("2816 × 1584 px");
const reopened = normalizeModelCapabilityConfig({ version: 1, image: profile });
expect(reopened.image?.size.presets?.filter((p) => p.tier === "1.5k")).toHaveLength(8);
expect(resolveImageRequestSize(profile, "auto", "1536x1536")?.value).toBe("1536x1536");
});
test("管理员档位开关按已有比例启用,部分比例不显示为关闭", () => {
for (const model of ["midjourney-1k", "midjourney-2k"]) {
const profile = defaultImageCapabilityConfig("cangyuan-midjourney-v82", model);