From fa36e7cd3530e40047cf1d9a8aec4f09f31a957a Mon Sep 17 00:00:00 2001 From: Dotta Date: Sat, 31 Oct 2026 09:45:06 -0500 Subject: [PATCH] test(chat): scope completion assertions to the delegated task link Assert the completion prefix and visible expected task link in the same message, including its exact destination, without relying on flat text across a status glyph. Co-Authored-By: Paperclip --- tests/e2e/agent-chat-projects.spec.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/tests/e2e/agent-chat-projects.spec.ts b/tests/e2e/agent-chat-projects.spec.ts index 89ec94ca54c..74cbb12c4e3 100644 --- a/tests/e2e/agent-chat-projects.spec.ts +++ b/tests/e2e/agent-chat-projects.spec.ts @@ -467,7 +467,20 @@ test("plan approval hands the preserved revision to an assigned project task", a expect(task.parentId).toBeNull(); expect(task.projectId).toBeTruthy(); expect(task.assigneeAgentId).toBe(f.agent.id); - await expect(page.getByText(`Delegated work completed: ${task.identifier}`, { exact: true })).toBeVisible(); + const completion = page.getByRole("region", { name: "Conversation messages" }) + .locator("p") + .filter({ hasText: /^Delegated work completed:/ }); + await expect(completion).toHaveCount(1); + const completedTask = completion.getByRole("link", { + name: `Issue ${task.identifier}: ${task.title}`, + exact: true, + }); + await expect(completedTask).toBeVisible(); + await expect(completedTask).toContainText(task.identifier); + await expect(completedTask).toHaveAttribute( + "href", + `/${f.company.issuePrefix}/issues/${task.identifier}`, + ); const plan = await json( await request.get(`/api/issues/${task.id}/documents/plan`), );