fix(canvas): 节点模型配置 - 清理音频参数并纳入回归测试

修复 PR #265 遗漏的音频节点参数残留,并将新增回归测试加入 web test 脚本。

Co-authored-by: dlh <2773843782@qq.com>
This commit is contained in:
dlh authored and ddCat committed 2026-08-19 20:52:11 +08:00
1 parent 6ecf4f4a10
commit 1502ccfc1d
3 files changed
+20 -1

No files matched your search

+15
View File
@@ -46,6 +46,21 @@ describe("applyNodeConfigPatch 模型切换清理生成参数", () => {
expect(next.metadata?.watermark).toBeUndefined();
});
test("音频参数随模型切换一并清理", () => {
const node = imageNode({
model: "default::tts-1",
audioVoice: "alloy",
audioFormat: "mp3",
audioSpeed: "1.25",
audioInstructions: "温暖、自然",
});
const next = applyNodeConfigPatch(node, { model: "default::gpt-4o-mini-tts" });
expect(next.metadata?.audioVoice).toBeUndefined();
expect(next.metadata?.audioFormat).toBeUndefined();
expect(next.metadata?.audioSpeed).toBeUndefined();
expect(next.metadata?.audioInstructions).toBeUndefined();
});
test("同一模型标识的参数调整不受影响", () => {
const node = imageNode({ model: "default::gpt-image-2", size: "1:1", quality: "high" });
const next = applyNodeConfigPatch(node, { model: "default::gpt-image-2", quality: "medium" });