Skip to content

Commit 2c81407

Browse files
committed
test(e2e): expand ChatThread reasoning and tool parts
1 parent 5f7db0d commit 2c81407

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

‎tests/e2e/chat-thread.spec.ts‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { expect, test } from "@playwright/test";
2+
3+
test("an agent turn renders its reasoning and tool parts, each expanding on click", async ({ page }) => {
4+
await page.goto("/chat-thread");
5+
const turn = page.getByRole("article", { name: "Scout replied" });
6+
await expect(turn.getByText("Three commits landed today.")).toBeVisible();
7+
8+
const reasoning = turn.locator("details");
9+
await expect(reasoning).not.toHaveAttribute("open");
10+
await reasoning.locator("summary").click();
11+
await expect(reasoning).toHaveAttribute("open");
12+
await expect(reasoning.getByText("Check the commit log first.")).toBeVisible();
13+
14+
const tool = turn.getByRole("button", { name: /Read today's commits/ });
15+
await expect(tool).toHaveAttribute("aria-expanded", "false");
16+
await tool.click();
17+
await expect(tool).toHaveAttribute("aria-expanded", "true");
18+
await expect(turn.getByText("3 commits")).toBeVisible();
19+
});

0 commit comments

Comments
 (0)