From febeb4e28b8608fa3a072dffb6b7943ec382461d Mon Sep 17 00:00:00 2001 From: Dudu-0223 Date: Tue, 20 Oct 2026 17:06:12 +0800 Subject: [PATCH] test(ui): cover named subagent navigation --- apps/web/tests/subagent-interrupt-ui.e2e.ts | 4 ++-- apps/web/tests/workflow-run.e2e.ts | 2 +- .../client/ui-subagent/tests/conversation-ui.client.spec.tsx | 2 ++ snapshots/web/subagent-interrupt/image-queue.expected.md | 2 +- snapshots/web/subagent-interrupt/offline-composer.expected.md | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/apps/web/tests/subagent-interrupt-ui.e2e.ts b/apps/web/tests/subagent-interrupt-ui.e2e.ts index 1201f4dac5..522cf78ace 100644 --- a/apps/web/tests/subagent-interrupt-ui.e2e.ts +++ b/apps/web/tests/subagent-interrupt-ui.e2e.ts @@ -210,7 +210,7 @@ describe.skipIf(MODE === 'record')('web e2e: composer interrupt for a running co await page.waitForSelector('[class*="frame"]', { timeout: 30_000 }) acknowledgeReloadConnectionLoss(tripwire, warningStart) await page.getByRole('button', { name: /1 subagent/ }).click() - await page.getByRole('treeitem', { name: new RegExp(LABEL) }).click() + await page.getByRole('treeitem', { name: new RegExp(LABEL) }).press('Enter') const input = page.locator('[data-composer-input]').first() await input.waitFor({ timeout: 15_000 }) await page.getByText(/^Explain event sourcing in one sentence\.Your name is /) @@ -272,7 +272,7 @@ describe.skipIf(MODE === 'record')('web e2e: composer interrupt for a running co await page.getByRole('navigation', { name: 'Session hierarchy' }) .getByRole('button').first().click() await page.getByRole('button', { name: /1 subagent/ }).click() - await page.getByRole('treeitem', { name: new RegExp(LABEL) }).click() + await page.getByRole('treeitem', { name: new RegExp(LABEL) }).press('Enter') // A live continuable child advertises the ordinary steer-all gesture, so // that placeholder is the composer's accessible name in this window. It // changes back as the queue drains, so later interactions address the diff --git a/apps/web/tests/workflow-run.e2e.ts b/apps/web/tests/workflow-run.e2e.ts index e43a7c7fb8..7fbd53a759 100644 --- a/apps/web/tests/workflow-run.e2e.ts +++ b/apps/web/tests/workflow-run.e2e.ts @@ -220,7 +220,7 @@ describe.skipIf(MODE === 'record')('web e2e: durable workflow run in Chat', () = await page.getByRole('button', { name: '1 subagent', exact: true }).hover() const catalog = page.getByRole('tree', { name: 'Subagent sessions' }) - await catalog.getByRole('treeitem', { name: /snapshot-flow child 1/ }).click() + await catalog.getByRole('treeitem', { name: /snapshot-flow child 1/ }).press('Enter') await page.getByText(CHILD_PROMPT, { exact: true }).waitFor({ timeout: 15_000 }) expect(await page.locator('[data-composer-input][contenteditable="true"]').count()).toBe(1) }, 60_000) diff --git a/packages/client/ui-subagent/tests/conversation-ui.client.spec.tsx b/packages/client/ui-subagent/tests/conversation-ui.client.spec.tsx index e0225cf5ac..b9c403bf5e 100644 --- a/packages/client/ui-subagent/tests/conversation-ui.client.spec.tsx +++ b/packages/client/ui-subagent/tests/conversation-ui.client.spec.tsx @@ -181,6 +181,8 @@ describe('SubagentHeaderLineage', () => { expect(name.compareDocumentPosition(toggle) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy() expect(toggle.textContent).toBe(description) expect(toggle.getAttribute('aria-expanded')).toBe('false') + fireEvent.keyDown(toggle, { key: 'Enter' }) + expect(input.openChild).not.toHaveBeenCalled() fireEvent.click(toggle) expect(toggle.getAttribute('aria-expanded')).toBe('true') expect(input.openChild).not.toHaveBeenCalled() diff --git a/snapshots/web/subagent-interrupt/image-queue.expected.md b/snapshots/web/subagent-interrupt/image-queue.expected.md index 115afc399d..d1d0d466d6 100644 --- a/snapshots/web/subagent-interrupt/image-queue.expected.md +++ b/snapshots/web/subagent-interrupt/image-queue.expected.md @@ -2,7 +2,7 @@ - navigation "Session hierarchy": - button "Ask a research subagent to" - text: / - - 'button "Switch subagent: event-sourcing researcher"': event-sourcing researcher + - 'button "Switch subagent: interrupt-worker"': interrupt-worker - text: Standard mode - button "More actions" - button "Open right sidebar" diff --git a/snapshots/web/subagent-interrupt/offline-composer.expected.md b/snapshots/web/subagent-interrupt/offline-composer.expected.md index 2c5ddcf9d0..e950810dd3 100644 --- a/snapshots/web/subagent-interrupt/offline-composer.expected.md +++ b/snapshots/web/subagent-interrupt/offline-composer.expected.md @@ -2,7 +2,7 @@ - navigation "Session hierarchy": - button "Ask a research subagent to" - text: / - - 'button "Switch subagent: event-sourcing researcher"': event-sourcing researcher + - 'button "Switch subagent: interrupt-worker"': interrupt-worker - text: Standard mode - button "More actions" - button "Open right sidebar"