test(e2e): smoke covers double-click dialog and label persistence

This commit is contained in:
Claude
2026-08-30 11:49:42 +00:00
parent 045cdb7b7e
commit 80ac663989

View File

@@ -1,6 +1,6 @@
import { test, expect } from "@playwright/test";
test("login → create workflow → drop node → save", async ({ page }) => {
test("login → create workflow → drop node → edit in dialog → save → reload persists label", async ({ page }) => {
await page.goto("/login");
await page.getByLabel(/password/i).fill("hunter2");
await page.getByRole("button", { name: /sign in/i }).click();
@@ -20,8 +20,27 @@ test("login → create workflow → drop node → save", async ({ page }) => {
await tile.dragTo(canvas);
await expect(page.locator(".react-flow__node")).toHaveCount(1);
// Double-click the just-dropped node to open the editor dialog.
const nodeEl = page.locator(".react-flow__node").first();
await nodeEl.dblclick();
// Dialog appears with the three column headings.
await expect(page.getByRole("heading", { name: /^input$/i })).toBeVisible();
await expect(page.getByRole("heading", { name: /^parameters$/i })).toBeVisible();
await expect(page.getByRole("heading", { name: /^output$/i })).toBeVisible();
// Edit the label to something distinctive.
const label = page.getByLabel(/node label/i);
await label.fill("Custom smoke node");
// Close the dialog with the Done button.
await page.getByRole("button", { name: /^done$/i }).click();
await expect(page.getByRole("heading", { name: /^parameters$/i })).not.toBeVisible();
await page.getByRole("button", { name: /save/i }).click();
// No visible confirmation — reload and assert the node persisted.
await page.reload();
await expect(page.locator(".react-flow__node")).toHaveCount(1);
// The canvas should show the custom label on the node.
await expect(page.locator(".react-flow__node")).toContainText("Custom smoke node");
});