fix: update unit test to expect pruning of non-existent node promotions

The test previously asserted that proxyWidgets entries referencing
non-existent nodes (id 9999) would be kept. This was the old buggy
behavior. The fix correctly prunes stale entries where the sourceNodeId
no longer exists in the subgraph.

Amp-Thread-ID: https://ampcode.com/threads/T-019d13a8-ed2d-726f-86f9-abbd8e859f9c
Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
Alexander Brown
2026-03-21 23:06:17 -07:00
parent 82ab634774
commit 2ac15286bf

View File

@@ -748,7 +748,7 @@ describe('SubgraphNode.widgets getter', () => {
])
})
test('full linked coverage does not prune unresolved independent fallback promotions', () => {
test('full linked coverage prunes promotions referencing non-existent nodes', () => {
const subgraph = createTestSubgraph({
inputs: [{ name: 'widgetA', type: '*' }]
})
@@ -773,9 +773,9 @@ describe('SubgraphNode.widgets getter', () => {
subgraphNode.rootGraph.id,
subgraphNode.id
)
// Node 9999 does not exist in the subgraph, so its entry is pruned
expect(promotions).toStrictEqual([
{ sourceNodeId: String(liveNode.id), sourceWidgetName: 'widgetA' },
{ sourceNodeId: '9999', sourceWidgetName: 'widgetA' }
{ sourceNodeId: String(liveNode.id), sourceWidgetName: 'widgetA' }
])
})