diff --git a/tests-ui/utils/index.js b/tests-ui/utils/index.js index 50399a7ef..01c58b21f 100644 --- a/tests-ui/utils/index.js +++ b/tests-ui/utils/index.js @@ -26,13 +26,16 @@ export async function checkBeforeAndAfterReload(graph, cb) { /** * @param { string } name * @param { Record } input - * @returns { import("../../web/types/comfy").ComfyObjectInfo } + * @param { (string | string[])[] | Record } output + * @returns { Record } */ -export function makeNodeDef(name, input) { +export function makeNodeDef(name, input, output = {}) { const nodeDef = { name, category: "test", + output: [], output_name: [], + output_is_list: [], input: { required: {} }, @@ -40,7 +43,19 @@ export function makeNodeDef(name, input) { for(const k in input) { nodeDef.input.required[k] = typeof input[k] === "string" ? [input[k], {}] : [...input[k]]; } - return nodeDef; + if(output instanceof Array) { + output = output.reduce((p, c) => { + p[c] = c; + return p; + }, {}) + } + for(const k in output) { + nodeDef.output.push(output[k]); + nodeDef.output_name.push(k); + nodeDef.output_is_list.push(false); + } + + return { [name]: nodeDef }; } /**