mirror of
https://github.com/block/buzz.git
synced 2026-10-30 05:51:46 +00:00
test(desktop): bind workflow message fills to step controls
The outgoing trigger inspector also labels its value input "Message text", so the shared label could fill the trigger field instead of the new send_message step during the AnimatePresence wait-mode swap, silently writing a trigger filter that suppresses the run-often warning and times out the Turn-on wait. Intersect the label with the first-step #wf-step-0-text control at all three workflows.spec.ts seams, assert the filled value, and reuse the already validated local-controls helper binding and settled operator geometry. Signed-off-by: Logan Johnson <loganj@squareup.com>
This commit is contained in:
@@ -63,7 +63,12 @@ async function addMessageStep(
|
||||
) {
|
||||
await dialog.getByRole("button", { name: "Add step", exact: true }).click();
|
||||
await page.getByRole("menuitem", { name: "Send Message" }).click();
|
||||
await dialog.getByLabel("Message text").fill("Workflow notification");
|
||||
// The outgoing trigger inspector also labels its input "Message text".
|
||||
const stepText = dialog
|
||||
.getByLabel("Message text", { exact: true })
|
||||
.and(dialog.locator("#wf-step-0-text"));
|
||||
await stepText.fill("Workflow notification");
|
||||
await expect(stepText).toHaveValue("Workflow notification");
|
||||
}
|
||||
|
||||
async function createEnabled(
|
||||
@@ -288,6 +293,7 @@ test("round-trips and reopens structured message-text conditions", async ({
|
||||
await openTriggerInspector(dialog);
|
||||
const matchControls = dialog.getByRole("group", { name: "Match" });
|
||||
const operatorButtons = matchControls.getByRole("button");
|
||||
await waitForAnimations(page);
|
||||
const firstOperatorBox = await operatorButtons.nth(0).boundingBox();
|
||||
const secondOperatorBox = await operatorButtons.nth(1).boundingBox();
|
||||
const thirdOperatorBox = await operatorButtons.nth(2).boundingBox();
|
||||
@@ -299,7 +305,6 @@ test("round-trips and reopens structured message-text conditions", async ({
|
||||
Math.abs((secondOperatorBox?.y ?? 0) - (firstOperatorBox?.y ?? 0)),
|
||||
).toBeLessThan(1);
|
||||
expect(thirdOperatorBox?.y).toBeGreaterThan(firstOperatorBox?.y ?? 0);
|
||||
await waitForAnimations(page);
|
||||
await matchControls.screenshot({
|
||||
path: "test-results/workflow-message-condition-operators.png",
|
||||
});
|
||||
|
||||
@@ -96,7 +96,11 @@ async function createWorkflow(
|
||||
|
||||
await dialog.getByRole("button", { name: "Add step", exact: true }).click();
|
||||
await page.getByRole("menuitem", { name: "Send Message" }).click();
|
||||
await dialog.getByLabel("Message text").fill("Workflow notification");
|
||||
const messageText = dialog
|
||||
.getByLabel("Message text")
|
||||
.and(dialog.locator("#wf-step-0-text"));
|
||||
await messageText.fill("Workflow notification");
|
||||
await expect(messageText).toHaveValue("Workflow notification");
|
||||
if (options?.stepName) {
|
||||
await dialog.getByRole("button", { name: "Step details" }).click();
|
||||
await dialog.getByLabel("Name (optional)").fill(options.stepName);
|
||||
@@ -700,7 +704,11 @@ test("captures the built editor at desktop and narrow widths", async ({
|
||||
await editWorkflowName(dialog, "editor_screenshot");
|
||||
await dialog.getByRole("button", { name: "Add step", exact: true }).click();
|
||||
await page.getByRole("menuitem", { name: "Send Message" }).click();
|
||||
await dialog.getByLabel("Message text").fill("Notify the workflow channel");
|
||||
const messageText = dialog
|
||||
.getByLabel("Message text")
|
||||
.and(dialog.locator("#wf-step-0-text"));
|
||||
await messageText.fill("Notify the workflow channel");
|
||||
await expect(messageText).toHaveValue("Notify the workflow channel");
|
||||
const inspector = dialog.getByTestId("workflow-node-inspector");
|
||||
|
||||
for (const viewport of [
|
||||
@@ -805,7 +813,11 @@ test("pane routes use stable IDs and Form/YAML changes stay synchronized", async
|
||||
|
||||
await dialog.getByRole("button", { name: "Add step", exact: true }).click();
|
||||
await page.getByRole("menuitem", { name: "Send Message" }).click();
|
||||
await dialog.getByLabel("Message text").fill("first message");
|
||||
const messageText = dialog
|
||||
.getByLabel("Message text")
|
||||
.and(dialog.locator("#wf-step-0-text"));
|
||||
await messageText.fill("first message");
|
||||
await expect(messageText).toHaveValue("first message");
|
||||
await expect(page).toHaveURL(/pane=step%3Astep_1/);
|
||||
|
||||
await dialog.getByRole("button", { name: "Add after Step 1" }).click();
|
||||
|
||||
Reference in New Issue
Block a user