mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-26 01:34:07 +00:00
Serialize NodeInputSlot.widget (#622)
Serialize linked widget on node input slot properly according to current
save format in
76818b54e6/src/extensions/core/widgetInputs.ts
This commit is contained in:
@@ -46,5 +46,27 @@ describe("NodeSlot", () => {
|
||||
const serialized = serializeSlot(normalSlot)
|
||||
expect(serialized).toHaveProperty("pos")
|
||||
})
|
||||
|
||||
it("preserves only widget name during serialization", () => {
|
||||
const widgetInputSlot: INodeInputSlot = {
|
||||
name: "test-id",
|
||||
type: "STRING",
|
||||
link: null,
|
||||
widget: {
|
||||
name: "test-widget",
|
||||
type: "combo",
|
||||
value: "test-value-1",
|
||||
options: {
|
||||
values: ["test-value-1", "test-value-2"],
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
const serialized = serializeSlot(widgetInputSlot)
|
||||
expect(serialized.widget).toEqual({ name: "test-widget" })
|
||||
expect(serialized.widget).not.toHaveProperty("type")
|
||||
expect(serialized.widget).not.toHaveProperty("value")
|
||||
expect(serialized.widget).not.toHaveProperty("options")
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user