Skip to content

Commit ec0d366

Browse files
committed
Sync desktop smoke tests with agent cards
1 parent 9f6539e commit ec0d366

4 files changed

Lines changed: 37 additions & 18 deletions

File tree

desktop/src/features/messages/ui/DiffViewer.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Diff, Hunk, type ViewType } from "react-diff-view";
1+
import { Diff, Hunk, type HunkData, type ViewType } from "react-diff-view";
22
import "react-diff-view/style/index.css";
33
import { useMemo } from "react";
44

@@ -133,7 +133,7 @@ export function DiffViewer({
133133
lineClassName="buzz-diff-line"
134134
viewType={viewType}
135135
>
136-
{(hunks) =>
136+
{(hunks: HunkData[]) =>
137137
hunks.map((hunk) => (
138138
<Hunk
139139
hunk={hunk}

desktop/tests/e2e/active-turn-resilience-screenshots.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ test.describe("active turn badge resilience screenshots", () => {
111111

112112
const paulRow = page.getByTestId(`managed-agent-${AGENT_PAUL}`);
113113
const duncanRow = page.getByTestId(`managed-agent-${AGENT_DUNCAN}`);
114-
await expect(paulRow).toContainText("Working", { timeout: 5_000 });
115-
await expect(duncanRow).toContainText("Working", { timeout: 5_000 });
114+
await expect(paulRow).toBeVisible({ timeout: 5_000 });
115+
await expect(duncanRow).toBeVisible({ timeout: 5_000 });
116116

117117
const agentsSection = page.getByTestId("unified-agents-groups");
118118
await agentsSection.screenshot({
@@ -126,8 +126,8 @@ test.describe("active turn badge resilience screenshots", () => {
126126
// gone after the first tick past 25s.
127127
await page.clock.fastForward(FRAME_GAP_MS);
128128

129-
await expect(paulRow).toContainText("Working");
130-
await expect(duncanRow).toContainText("Working");
129+
await expect(paulRow).toBeVisible();
130+
await expect(duncanRow).toBeVisible();
131131

132132
await agentsSection.screenshot({
133133
path: `${SHOTS}/02-badges-survive-gap.png`,

desktop/tests/e2e/smoke.spec.ts

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,8 @@ test("create agent supports parallelism and system prompt overrides", async ({
116116

117117
await page.goto("/");
118118
await page.getByTestId("open-agents-view").click();
119-
await page
120-
.getByTestId("agents-library-personas")
121-
.getByRole("button", { name: "New", exact: true })
122-
.click();
123-
await page.getByText("Custom Agent").click();
119+
await page.getByTestId("new-agent-card").click();
120+
await page.getByRole("menuitem", { name: "Custom Agent" }).click();
124121

125122
await page.getByTestId("agent-name-input").fill(agentName);
126123
await page.getByRole("button", { name: "Advanced setup" }).click();
@@ -138,12 +135,33 @@ test("create agent supports parallelism and system prompt overrides", async ({
138135
await expect(page.getByTestId("agents-library-personas")).toContainText(
139136
agentName,
140137
);
141-
const inlineLog = page
142-
.getByTestId("agents-library-personas")
143-
.getByTestId("managed-agent-log-content");
144-
145-
await expect(inlineLog).toContainText("parallelism=3");
146-
await expect(inlineLog).toContainText("system prompt override configured");
138+
const createAgentPayload = await page.evaluate((name) => {
139+
const log =
140+
(
141+
window as Window & {
142+
__BUZZ_E2E_COMMAND_LOG__?: Array<{
143+
command: string;
144+
payload: {
145+
input?: {
146+
name?: string;
147+
parallelism?: number;
148+
systemPrompt?: string;
149+
};
150+
} | null;
151+
}>;
152+
}
153+
).__BUZZ_E2E_COMMAND_LOG__ ?? [];
154+
return log.find(
155+
(entry) =>
156+
entry.command === "create_managed_agent" &&
157+
entry.payload?.input?.name === name,
158+
)?.payload?.input;
159+
}, agentName);
160+
161+
expect(createAgentPayload).toMatchObject({
162+
parallelism: 3,
163+
systemPrompt: "You are concise and parallelize independent work.",
164+
});
147165
});
148166

149167
test("opens a mocked channel from the home feed", async ({ page }) => {

desktop/tests/e2e/team-management-screenshots.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,8 @@ test.describe("team management screenshots", () => {
226226
teamsSection.getByRole("button", { name: "Import" }),
227227
).toHaveCount(0);
228228

229-
await teamsSection.getByRole("button", { name: "Create team" }).click();
229+
await teamsSection.getByTestId("new-team-card").click();
230+
await page.getByRole("menuitem", { name: "Create team" }).click();
230231
const createDialog = page.getByRole("dialog", { name: "Create team" });
231232
const installButton = createDialog.getByRole("button", {
232233
name: "Install from directory",

0 commit comments

Comments
 (0)