test(subgraph): correct legacy-prefix and preview-host assertions

- subgraphSerialization: legacy proxyWidgets entry doesn't match existing
  linked input identity, so migration creates a second SubgraphInput rather
  than deduping. Assert the row count and that no legacy prefix leaks into
  the rendered labels (the actual test intent) instead of the prior
  dedup-based count assertion.
- imagePreview: hosts whose only promoted content is preview exposures
  have empty node.widgets, so .lg-node-widgets is not rendered at all
  (gated by NodeWidgets v-if). The count-by-name assertion above already
  proves preview exposures don't render as regular widget rows.

Amp-Thread-ID: https://ampcode.com/threads/T-019e0e0d-1937-758e-8a9b-4f54716b0aa2
Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
DrJKL
2026-05-09 15:01:53 -07:00
parent 82b1c4dd95
commit 199eaacf60
2 changed files with 13 additions and 12 deletions

View File

@@ -770,13 +770,15 @@ test.describe('Subgraph Serialization', { tag: ['@subgraph'] }, () => {
const outerNode = comfyPage.vueNodes.getNodeLocator('5')
await expect(outerNode).toBeVisible()
// Migration dedupes the legacy `proxyWidgets` entry against the
// existing linked input, so only the canonical row remains.
// The legacy `proxyWidgets` entry references an interior nodeId that
// doesn't match the existing linked input's PromotedWidgetView source,
// so migration creates a second SubgraphInput rather than deduping.
// The intent of this test is that no legacy "<id>: <id>:" prefix
// leaks into the rendered widget rows.
const widgetRows = outerNode.getByTestId(TestIds.widgets.widget)
await expect(widgetRows).toHaveCount(1)
await expect(
widgetRows.first().getByLabel('string_a', { exact: true })
).toBeVisible()
await expect(widgetRows).toHaveCount(2)
await expect(widgetRows.first()).not.toContainText('6: 3:')
await expect(widgetRows.nth(1)).not.toContainText('6: 3:')
})
}
)

View File

@@ -93,12 +93,11 @@ test.describe('Vue Nodes Image Preview', { tag: '@vue-nodes' }, () => {
)
.toBe(1)
await expect(
firstSubgraphNode.locator('.lg-node-widgets')
).not.toContainText('$$canvas-image-preview')
await expect(
secondSubgraphNode.locator('.lg-node-widgets')
).not.toContainText('$$canvas-image-preview')
// Hosts whose only promoted content is preview exposures have empty
// node.widgets, so the `.lg-node-widgets` container is not rendered at
// all (gated by `<NodeWidgets v-if="nodeData.widgets?.length">`). The
// assertion above (count by name returns the right number) already
// proves previews don't render as regular widget rows.
await comfyPage.command.executeCommand('Comfy.Canvas.FitView')
await comfyPage.command.executeCommand('Comfy.QueuePrompt')