Skip to content

test(agent): pin the agent row actions - AgentActions (Closes #1836) - #1971

Merged
dmitrii-f-t27 merged 1 commit into
queenfrom
zcode-mbp/tests-1836-agent-actions
Oct 14, 2026
Merged

dmitrii-f-t27 merged 1 commit into
queenfrom
zcode-mbp/tests-1836-agent-actions

Conversation

@dmitrii-f-t27

Copy link
Copy Markdown
Collaborator

Closes #1836

What

The first suite for apps/agent/entrypoints/app/agents/agent-row/AgentActions.tsx (AgentActions, the only export), under bun test in the agent group.

  • describe block: AgentActionsTsxContract (appears nowhere else in the tree).
  • Minimal mock surface: only the router hook is stubbed (query-qualified spread-real read keeping every other export); the dropdown and tooltip kits stay real (their triggers survive a static render, as the open-in-chat and web-preview suites show), and the display helpers (displayName, canDelete, canRename) stay real β€” the aria-label pin exercises the real displayName against the fixture agent.
  • Pin: an active turn draws the filled Resume button and no active turn the outlined Chat one; both name the agent on the more-actions trigger (More actions for Research Bot); the dropdown's menu content stays hidden as the menu first mounts. The menu items, coming-soon tooltips and the delete/copy/navigate flows sit behind the kits' internal open states and a live document β€” named in the suite header per User Story 2.
  • FR-004 shown both ways, quoted: broken subject (Resume button relabelled) β†’ 0 pass / 1 fail; restored β†’ 1 pass / 0 fail / 8 expect(). git diff --name-only lists only the new test file.

Local gates

  • Suite: 1 pass / 0 fail (8 expect()); grep -c 'it(' = 1; 1 + 0 blocked = 1.
  • Group (apps/agent): 262 pass / 3 fail / 265 tests β€” the 3 = the pre-existing port-helper noise, unchanged from baseline.
  • Biome: 0 (no fixes needed). Typecheck: 19 = base, 0 mentions of the new file.

No database, no container, no network.

@tri-claw

tri-claw Bot commented Oct 14, 2026

Copy link
Copy Markdown

Summary by t27-bees

This PR adds a contract test for the AgentActions component to pin its current rendering behavior (Resume vs Chat button based on activeTurnId, more-actions trigger label, dropdown menu hidden on mount) so future changes have a baseline to fail against. Only the router's useNavigate is stubbed; the dropdown, tooltip kits, and display helpers remain real.

Worth a look

  • AgentActions.test.ts:28 – useNavigate is mocked as () => () => {}, but react-router's useNavigate returns a function accepting (to: To, options?: NavigateOptions). If the component ever calls navigate(path) during render (e.g., in an effect), the mock swallows the call silently; a stricter mock or vi.fn() would surface misuse.
  • AgentActions.test.ts:15–18 – The query-qualified imports (react-router?agent-actions-real, ./AgentActions?agent-actions-suite-real) rely on Bun's module re-instantiation feature. This is non-standard and may break if Bun changes its import reflection semantics or if the test runs under a different runtime.
  • AgentActions.test.ts:55–65 – Assertions check for raw strings ('Resume', 'Chat', 'More actions for Research Bot'). These are coupled to display copy; any i18n, redesign, or displayName change will fail the test without signaling a real regression.
  • AgentActions.test.ts:48 – The fixture hard-codes canChat: true, canDelete: true. The test doesn't cover the canChat=false or canDelete=false branches, so a prop-driven render difference would go unnoticed.
  • AgentActions.test.ts:50 – renderToStaticMarkup produces a static HTML string; it does not execute effects, ref callbacks, or event handlers. The dropdown's open-state content (Copy id, Delete) is correctly hidden on mount, but the test cannot verify that clicking the trigger reveals themβ€”a gap called out in the header but still a blind spot.

Read: 1 files, +92 -0, the whole diff. Head 1c3ab9c. Model: openai-compatible/nvidia/nemotron-3-ultra-550b-a55b. Commands: @t27-bees review | summary | help | pause | resume. Free for every repository.

@github-actions

Copy link
Copy Markdown

βœ… Tests passed β€” 3637/3707

Suite Passed Failed Skipped
βœ… agent 265/265 0 0
βœ… build 9/9 0 0
βœ… cdp-protocol 5/5 0 0
βœ… eval 93/93 0 0
βœ… server-agent 280/280 0 0
βœ… server-api 2159/2228 0 69
βœ… server-browser 6/6 0 0
βœ… server-integration 10/11 0 1
βœ… server-lib 279/279 0 0
βœ… server-pglive 166/166 0 0
βœ… server-root 68/68 0 0
βœ… server-sim 8/8 0 0
βœ… server-skills 31/31 0 0
βœ… server-tools 244/244 0 0
βœ… shared 14/14 0 0

View workflow run

@dmitrii-f-t27
dmitrii-f-t27 merged commit b4db71d into queen Oct 14, 2026
17 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant