From fc70097ceb9e14dacd230cac3baa251fd3fa5345 Mon Sep 17 00:00:00 2001 From: Christian Byrne Date: Fri, 11 Sep 2026 13:56:07 -0700 Subject: [PATCH] test(group-node): assert widget PAIRING, not set membership MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The test I added in #17393 could not fail on the bug it was written for. It flattened every interior widget value into one array and asserted arrayContaining + length 14. Misalignment shuffles values BETWEEN widgets, so the multiset is identical and the length is unchanged — the assertion passes on corrupted data. That is a test that fossilizes the defect. QA hit the real behaviour on 2026-09-10 running the 1.54 plan: converting a v1.3.3 group node shifts widget values two positions, so denoise receives 'euler' and filename_prefix receives 'normal'. On a group node wrapping two samplers, six values land wrong on one node, including strings in numeric fields (noise_seed = 'enable') and a number in a combo (control_after_generate = 0). Deterministic over 16 loads, reproduces through the Workflows sidebar, and saving writes the wrong values back to disk. Now reads each interior node's widgets as a name -> value map and asserts the pairing the asset actually declares: KSampler seed/steps/cfg/sampler_name/ scheduler/denoise, SaveImage filename_prefix. toBeDefined() runs first so a missing node cannot make toMatchObject vacuous. Pinned with test.fail(), matching subgraphPromotion.spec.ts and subgraphConvertAutogrowInputs.spec.ts. CI stays green while the bug exists, and flips red the moment the conversion is fixed, which is the signal to drop the marker. --- browser_tests/tests/groupNode.spec.ts | 46 +++++++++++++++++++-------- 1 file changed, 33 insertions(+), 13 deletions(-) diff --git a/browser_tests/tests/groupNode.spec.ts b/browser_tests/tests/groupNode.spec.ts index 79f3a96c096..194f84c7bd0 100644 --- a/browser_tests/tests/groupNode.spec.ts +++ b/browser_tests/tests/groupNode.spec.ts @@ -30,28 +30,48 @@ test.describe('Group node migration', { tag: '@node' }, () => { expect(state.hasGroupNodesExtra).toBe(false) }) + // QA found this broken on 2026-09-10 while running the 1.54 test plan: + // converting a v1.3.3 group node misaligns widget values by two positions, so + // denoise receives 'euler' and filename_prefix receives 'normal'. Saving then + // writes the wrong values back, silently corrupting the workflow. Pinned with + // test.fail() so the fix flips this to passing. test('Preserves group node widget values through subgraph conversion', async ({ comfyPage }) => { + test.fail() await comfyPage.workflow.loadWorkflow('groupnodes/group_node_v1.3.3') - const interiorValues = await comfyPage.page.evaluate(() => + const interiorNodes = await comfyPage.page.evaluate(() => [...window.app!.graph.subgraphs.values()].flatMap((subgraph) => - subgraph.nodes.flatMap( - (node) => node.widgets?.map((widget) => widget.value) ?? [] - ) + subgraph.nodes.map((node) => ({ + type: node.type, + widgets: Object.fromEntries( + (node.widgets ?? []).map((widget) => [widget.name, widget.value]) + ) + })) ) ) - expect(interiorValues).toHaveLength(14) - expect(interiorValues).toEqual( - expect.arrayContaining([ - 156680208700286, - 'euler', - 'v1-5-pruned-emaonly.ckpt', - expect.stringContaining('purple galaxy bottle') - ]) - ) + const ksampler = interiorNodes.find((node) => node.type === 'KSampler') + expect( + ksampler, + 'converted subgraph should contain a KSampler' + ).toBeDefined() + expect(ksampler!.widgets).toMatchObject({ + seed: 156680208700286, + steps: 20, + cfg: 8, + sampler_name: 'euler', + scheduler: 'normal', + denoise: 1 + }) + + const saveImage = interiorNodes.find((node) => node.type === 'SaveImage') + expect( + saveImage, + 'converted subgraph should contain a SaveImage' + ).toBeDefined() + expect(saveImage!.widgets).toMatchObject({ filename_prefix: 'ComfyUI' }) }) test(