Skip to content

test(agent): pin the new-agent dialog - NewAgentDialog (Closes #1544) - #1970

Merged
dmitrii-f-t27 merged 1 commit into
queenfrom
zcode-mbp/tests-1544-new-agent-dialog
Oct 14, 2026
Merged

dmitrii-f-t27 merged 1 commit into
queenfrom
zcode-mbp/tests-1544-new-agent-dialog

Conversation

@dmitrii-f-t27

Copy link
Copy Markdown
Collaborator

Closes #1544

What

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

  • describe block: NewAgentDialogTsxContract (appears nowhere else in the tree).
  • Everything the dialog draws is prop-driven: the provider selector and the CLI provider status panel stay the real modules their own suites pin, the select kit stays real (proven static-safe by the OpenClaw controls suite), and only the Radix dialog is stubbed with the group's portal-free stand-in carrying all 10 value exports of the kit, root honouring the open flag.
  • Pin: the closed dialog renders nothing; the open one answers the title, the name field with the harness placeholder, the adapter/model/reasoning labels and the footer buttons; the blocked OpenClaw runtime answers the not-ready alert with the provider selector still drawn; a create failure answers the alert with its message. The button callbacks and Enter-to-create path are named in the suite header per User Story 2.
  • FR-004 shown both ways, quoted: broken subject (harness placeholder string) β†’ 0 pass / 1 fail; restored β†’ 1 pass / 0 fail / 15 expect(). (A first break attempt β€” extending the title string β€” was a false green caught before proceeding: a superstring of the pin still satisfies toContain; the break must not contain the pinned substring.) git diff --name-only lists only the new test file.

Local gates

  • Suite: 1 pass / 0 fail (15 expect()); grep -c 'it(' = 1; 1 + 0 blocked = 1.
  • Group (apps/agent): 261 pass / 3 fail / 264 tests β€” the 3 = the pre-existing port-helper noise, unchanged from baseline.
  • Biome: 0. 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 NewAgentDialog that pins its current static rendering behavior across four states (closed, open, OpenClaw-blocked, create-failed) using a portal-free Radix dialog stub and renderToStaticMarkup.

Worth a look

  • Line 133: expect(harness).toContain('Review bot') but baseProps defines name: 'Bot' β€” the test expects a string the props don't provide. If the component doesn't transform "Bot" into "Review bot", this assertion will fail.
  • Lines 68–71: The dynamic import ./NewAgentDialog?new-agent-dialog-suite-real relies on Vite's query-parameter module duplication. This is non-standard, couples the test to the dev server/build tool, and may break under different bundlers or in CI if the query handling changes.
  • Lines 50–66: The Radix dialog mock assumes exactly 10 named exports with specific prop shapes (Dialog requires open, DialogOverlay returns null, etc.). If the component uses any other export (e.g., DialogTrigger with different props) or the kit adds/removes exports, the stub will drift from reality.
  • Line 130–147: A single it block with 15 expect() calls. The first failure stops the rest, hiding regressions in later assertions (e.g., the OpenClaw-blocked and create-failure branches won't be checked if the open-dialog title check fails).
  • Line 73: Parameters<typeof NewAgentDialog>[0] infers props from the component type. If NewAgentDialog is wrapped with forwardRef or memo, this may resolve to the inner component's props (missing ref) or any, weakening type safety.

Read: 1 files, +153 -0, the whole diff. Head 019883e. 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 β€” 3636/3706

Suite Passed Failed Skipped
βœ… agent 264/264 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 0606407 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