From 9c35cf2b4a230792a4db9034ba0dcf27800af7c4 Mon Sep 17 00:00:00 2001 From: klopez4212 Date: Fri, 19 Jun 2026 12:36:42 +0100 Subject: [PATCH] Sync desktop smoke tests with agent cards --- .../src/features/messages/ui/DiffViewer.tsx | 4 +- ...active-turn-resilience-screenshots.spec.ts | 8 ++-- desktop/tests/e2e/smoke.spec.ts | 38 ++++++++++++++----- .../e2e/team-management-screenshots.spec.ts | 3 +- 4 files changed, 36 insertions(+), 17 deletions(-) diff --git a/desktop/src/features/messages/ui/DiffViewer.tsx b/desktop/src/features/messages/ui/DiffViewer.tsx index 239fd0211..1c46a871c 100644 --- a/desktop/src/features/messages/ui/DiffViewer.tsx +++ b/desktop/src/features/messages/ui/DiffViewer.tsx @@ -1,4 +1,4 @@ -import { Diff, Hunk, type ViewType } from "react-diff-view"; +import { Diff, Hunk, type HunkData, type ViewType } from "react-diff-view"; import "react-diff-view/style/index.css"; import { useMemo } from "react"; @@ -133,7 +133,7 @@ export function DiffViewer({ lineClassName="buzz-diff-line" viewType={viewType} > - {(hunks) => + {(hunks: HunkData[]) => hunks.map((hunk) => ( { const paulRow = page.getByTestId(`managed-agent-${AGENT_PAUL}`); const duncanRow = page.getByTestId(`managed-agent-${AGENT_DUNCAN}`); - await expect(paulRow).toContainText("Working", { timeout: 5_000 }); - await expect(duncanRow).toContainText("Working", { timeout: 5_000 }); + await expect(paulRow).toBeVisible({ timeout: 5_000 }); + await expect(duncanRow).toBeVisible({ timeout: 5_000 }); const agentsSection = page.getByTestId("unified-agents-groups"); await agentsSection.screenshot({ @@ -126,8 +126,8 @@ test.describe("active turn badge resilience screenshots", () => { // gone after the first tick past 25s. await page.clock.fastForward(FRAME_GAP_MS); - await expect(paulRow).toContainText("Working"); - await expect(duncanRow).toContainText("Working"); + await expect(paulRow).toBeVisible(); + await expect(duncanRow).toBeVisible(); await agentsSection.screenshot({ path: `${SHOTS}/02-badges-survive-gap.png`, diff --git a/desktop/tests/e2e/smoke.spec.ts b/desktop/tests/e2e/smoke.spec.ts index c0d60d3c2..3a5992b2d 100644 --- a/desktop/tests/e2e/smoke.spec.ts +++ b/desktop/tests/e2e/smoke.spec.ts @@ -115,11 +115,8 @@ test("create agent supports parallelism and system prompt overrides", async ({ await page.goto("/"); await page.getByTestId("open-agents-view").click(); - await page - .getByTestId("agents-library-personas") - .getByRole("button", { name: "New", exact: true }) - .click(); - await page.getByText("Custom Agent").click(); + await page.getByTestId("new-agent-card").click(); + await page.getByRole("menuitem", { name: "Custom Agent" }).click(); await page.getByTestId("agent-name-input").fill(agentName); await page.getByRole("button", { name: "Advanced setup" }).click(); @@ -137,12 +134,33 @@ test("create agent supports parallelism and system prompt overrides", async ({ await expect(page.getByTestId("agents-library-personas")).toContainText( agentName, ); - const inlineLog = page - .getByTestId("agents-library-personas") - .getByTestId("managed-agent-log-content"); + const createAgentPayload = await page.evaluate((name) => { + const log = + ( + window as Window & { + __BUZZ_E2E_COMMAND_LOG__?: Array<{ + command: string; + payload: { + input?: { + name?: string; + parallelism?: number; + systemPrompt?: string; + }; + } | null; + }>; + } + ).__BUZZ_E2E_COMMAND_LOG__ ?? []; + return log.find( + (entry) => + entry.command === "create_managed_agent" && + entry.payload?.input?.name === name, + )?.payload?.input; + }, agentName); - await expect(inlineLog).toContainText("parallelism=3"); - await expect(inlineLog).toContainText("system prompt override configured"); + expect(createAgentPayload).toMatchObject({ + parallelism: 3, + systemPrompt: "You are concise and parallelize independent work.", + }); }); test("opens a mocked channel from the home feed", async ({ page }) => { diff --git a/desktop/tests/e2e/team-management-screenshots.spec.ts b/desktop/tests/e2e/team-management-screenshots.spec.ts index 5650f6dd3..6ee964900 100644 --- a/desktop/tests/e2e/team-management-screenshots.spec.ts +++ b/desktop/tests/e2e/team-management-screenshots.spec.ts @@ -226,7 +226,8 @@ test.describe("team management screenshots", () => { teamsSection.getByRole("button", { name: "Import" }), ).toHaveCount(0); - await teamsSection.getByRole("button", { name: "Create team" }).click(); + await teamsSection.getByTestId("new-team-card").click(); + await page.getByRole("menuitem", { name: "Create team" }).click(); const createDialog = page.getByRole("dialog", { name: "Create team" }); const installButton = createDialog.getByRole("button", { name: "Install from directory",