fix(image): 补充分辨率档位编辑

This commit is contained in:
ddcat666
2026-10-13 22:47:49 +08:00
parent 17e9f5ed4e
commit 32f3f1df5a
2 changed files with 62 additions and 19 deletions

View File

@@ -158,6 +158,15 @@ describe("plugin image parameters across model configuration and generation", ()
expect(html).not.toContain('role="combobox"');
expect(html).not.toContain("16:9");
});
test("unconstrained resolution editor offers standard 1K/2K/4K choices", () => {
const field: ImageParameter = { name: "imageResolution", label: "分辨率", type: "string", default: "1k", pricing: true };
const html = renderToStaticMarkup(<ImageParameterSchemaEditor definitions={[field]} parameters={[field]} onChange={() => {}} />);
expect(html).toContain("1K");
expect(html).toContain("2K");
expect(html).toContain("4K");
expect(html).toContain("分辨率快捷选择");
expect(html).toContain("输入后按回车,或点击下方档位");
});
test("resolution-only contract renders no invented quality or pixel-tier controls", () => {
const { image, config } = fixture([parameters[0]]);
const html = renderToStaticMarkup(<ImageParameterFields profile={image} config={config} onChange={() => {}} />);