From 893c668e1475997142c27dc661def869f56a848a Mon Sep 17 00:00:00 2001 From: Logan Johnson Date: Thu, 10 Sep 2026 02:16:02 -0400 Subject: [PATCH] test(desktop): pin workflow form-builder fill handoff and saved payload The committed form-builder scenario could not distinguish a wrong-target "Message text" fill under ordinary timing: the outgoing trigger inspector keeps its identically labeled input actionable through the AnimatePresence wait-mode handoff to the first step textarea, so the repaired locator still needs committed causal coverage. Slow only the animations that contain the outgoing trigger input, run the unchanged helper fill and value assertion inside that real handoff window, then parse the actual recorded create_workflow.payload.yamlDefinition to require the persisted step_1 id and "Workflow notification" text and an unfiltered message_posted trigger. Under this schedule a first-seam wrong-target mutant fails at the existing value assertion instead of passing 1/1; the restored scenario and the full 29-test workflows spec stay green. The check reads the production serializer's own saved YAML (steps[0].id/text), not a test-authored shape. Signed-off-by: Logan Johnson --- desktop/tests/e2e/workflows.spec.ts | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/desktop/tests/e2e/workflows.spec.ts b/desktop/tests/e2e/workflows.spec.ts index 38e95034f0..af83102b88 100644 --- a/desktop/tests/e2e/workflows.spec.ts +++ b/desktop/tests/e2e/workflows.spec.ts @@ -221,8 +221,32 @@ test("creates a workflow via the form builder", async ({ page }) => { const workflowName = `test_workflow_${Date.now()}`; await navigateToWorkflows(page); + // Keep the outgoing trigger's Message text mounted during the step handoff. + await page.evaluate(() => { + const animate = Element.prototype.animate; + Element.prototype.animate = function (...args) { + const animation = animate.apply(this, args); + if (this.querySelector("#wf-trigger-trigger_text-value")) { + animation.updatePlaybackRate(0.1); + } + return animation; + }; + }); await createWorkflow(page, workflowName); + const yaml = await page.evaluate(() => { + const call = [...(window.__BUZZ_E2E_COMMAND_PAYLOADS__ ?? [])] + .reverse() + .find((candidate) => candidate.command === "create_workflow"); + return (call?.payload as { yamlDefinition?: string } | undefined) + ?.yamlDefinition; + }); + const saved = parseYaml(yaml ?? ""); + expect(saved.steps[0].id).toBe("step_1"); + expect(saved.steps[0].text).toBe("Workflow notification"); + expect(saved.trigger.on).toBe("message_posted"); + expect(saved.trigger.filter).toBeUndefined(); + // Verify workflow appears in the list await expect(page.getByTestId("workflows-view")).toContainText(workflowName); });