Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -258,4 +258,71 @@ describe('SubgraphNode multi-instance widget isolation', () => {
const serialized = instance.serialize()
expect(serialized.widgets_values).toBeUndefined()
})

// it.fails pins the open #10849 SubgraphNode.configure regression on Main;
// drop the marker once the inline-proxyWidgets-state fix lands.
it.fails('falls back to source widget value when proxyWidgets is in legacy 2-tuple shape (regression for #10849)', () => {
const subgraph = createTestSubgraph({
inputs: [{ name: 'value', type: 'number' }]
})

const SOURCE_DEFAULT = 42
const LEGACY_NOISE = 999

const { node } = createNodeWithWidget('TestNode', SOURCE_DEFAULT)
subgraph.add(node)
subgraph.inputNode.slots[0].connect(node.inputs[0], node)

const instance = createTestSubgraphNode(subgraph, { id: 801 })
instance.configure({
id: 801,
type: subgraph.id,
pos: [100, 100],
size: [200, 100],
inputs: [],
outputs: [],
mode: 0,
order: 0,
flags: {},
properties: { proxyWidgets: [['-1', 'widget']] },
widgets_values: [LEGACY_NOISE]
})

const widget = instance.widgets?.[0]
expect(widget?.value).toBe(SOURCE_DEFAULT)
expect(widget?.serializeValue?.(instance, 0)).toBe(SOURCE_DEFAULT)
})

it.fails('does not corrupt unbound promoted widgets when widgets_values length mismatches view count (regression for #10849)', () => {
const subgraph = createTestSubgraph({
inputs: [{ name: 'value', type: 'number' }]
})

const SOURCE_DEFAULT = 42
const LEGACY_NOISE_A = 111
const LEGACY_NOISE_B = 222

const { node } = createNodeWithWidget('TestNode', SOURCE_DEFAULT)
subgraph.add(node)
subgraph.inputNode.slots[0].connect(node.inputs[0], node)

const instance = createTestSubgraphNode(subgraph, { id: 802 })
instance.configure({
id: 802,
type: subgraph.id,
pos: [100, 100],
size: [200, 100],
inputs: [],
outputs: [],
mode: 0,
order: 0,
flags: {},
properties: { proxyWidgets: [['-1', 'widget']] },
widgets_values: [LEGACY_NOISE_A, LEGACY_NOISE_B]
})

const widget = instance.widgets?.[0]
expect(widget?.value).toBe(SOURCE_DEFAULT)
expect(widget?.value).not.toBe(LEGACY_NOISE_A)
})
})
Loading