From aff889b5b5be07a24e12ff9e5d164420cf8a95c7 Mon Sep 17 00:00:00 2001 From: Duncan Date: Mon, 17 Aug 2026 20:08:57 -0400 Subject: [PATCH] test(desktop): drive merged edit dialog in access-tightening e2e PR #6086's agent-access-warning spec assumed the pre-merge two-dialog structure (Advanced toggle, "Customize for this agent" tab, #persona-system-prompt). The merged dialog surfaces the instance-owned respond-to control inline and renames the definition prompt field to #edit-agent-system-prompt, so the stale locators no longer resolve. Adapt the spec to the merged surface; the instance-scoped save assertions are unchanged. Co-authored-by: Will Pfleger Signed-off-by: Will Pfleger --- desktop/tests/e2e/agent-access-warning.spec.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/desktop/tests/e2e/agent-access-warning.spec.ts b/desktop/tests/e2e/agent-access-warning.spec.ts index adb9c6d58a..b1ffc8e876 100644 --- a/desktop/tests/e2e/agent-access-warning.spec.ts +++ b/desktop/tests/e2e/agent-access-warning.spec.ts @@ -192,12 +192,13 @@ test("full agent editor tightens the exact sidebar agent instance", async ({ await page.getByTestId(`sidebar-member-${agent.pubkey}`).click(); await expect(page.getByTestId("user-profile-panel")).toBeVisible(); await page.getByTestId("user-profile-edit-agent").click(); - const dialog = page.getByRole("dialog", { name: "Edit agent" }); + const dialog = page.getByTestId("edit-agent-dialog"); await expect(dialog).toBeVisible(); - await dialog.getByRole("button", { name: "Advanced" }).click(); + // The merged dialog surfaces the instance-owned access control inline (no + // Advanced toggle, no per-agent tab): a linked agent's respond-to lives in + // the instance section directly. await choosePersonaAccess(page, "Only me (default)"); - await dialog.getByRole("tab", { name: "Customize for this agent" }).click(); - const saveChanges = dialog.getByRole("button", { name: "Save changes" }); + const saveChanges = dialog.getByTestId("edit-agent-dialog-submit"); await expect(saveChanges).toBeEnabled(); await saveChanges.click(); await expect(dialog).not.toBeVisible(); @@ -228,14 +229,13 @@ test("full agent editor tightens the exact sidebar agent instance", async ({ await page.getByTestId(`sidebar-member-${agent.pubkey}`).click(); await page.getByTestId("user-profile-edit-agent").click(); await expect(dialog).toBeVisible(); - await dialog.getByRole("button", { name: "Advanced" }).click(); await expect(page.locator("#agent-respond-to")).toHaveText( "Only me (default)", ); await page - .locator("#persona-system-prompt") + .locator("#edit-agent-system-prompt") .fill("Test unrelated prompt editing after tightening access."); - await dialog.getByRole("button", { name: "Save changes" }).click(); + await dialog.getByTestId("edit-agent-dialog-submit").click(); await expect(dialog).not.toBeVisible(); const unrelatedEditCommand = await page.evaluate(