Skip to content

test(agent): pin the connect-MCP page - ConnectMCP (Closes #1519) - #1963

Merged
dmitrii-f-t27 merged 1 commit into
queenfrom
zcode-mbp/tests-1519-connect-mcp
Oct 14, 2026
Merged

dmitrii-f-t27 merged 1 commit into
queenfrom
zcode-mbp/tests-1519-connect-mcp

Conversation

@dmitrii-f-t27

Copy link
Copy Markdown
Collaborator

Closes #1519

What changed

One new file: trios/agent-server/apps/entrypoints/app/connect-mcp/ConnectMCP.test.ts (the path the issue's Success Criteria names). The subject ConnectMCP.tsx is untouched.

The 1 exported symbol is exercised (1 it( block; 0 blocked). The page reads the MCP server store, the managed-server mutations, the servers list, the user integrations and the remote sync, so each seam is stubbed with a full stand-in: the store with an empty server list and its mutators, the four mutation/list hooks with idle captures, the integrations hook with no data, the sync with a settled status, the metrics track (a no-op - its real module pulls the adapter graph other suites stub incompletely), and the storage fake underneath the graph's own items. Measured, the static render goes through and shows the page as it first mounts: the Connected Apps heading with its two add controls.

Not pinned, and why (issue User Story 2): the connect flow itself - the auth navigation (window.open), the api-key submission, the add/remove wiring and its toasts - they live in handlers that need a live document and window. The port env seam is seeded before any import can reach the env module (its one-time snapshot - the trap the agent-outputs suite documented), with the subject imported dynamically for that reason.

How it was verified (FR-004)

  • Passing run against the unmodified subject: 1 pass / 0 fail / 3 expect() calls, Ran 1 test across 1 file.
  • Deliberately broken copy (the heading changed, valid syntax): 1 fail out of 1 - the pin fails on the heading. An earlier break candidate that only extended a pinned substring (Add built-in app -> Add built-in application) produced a false-green red run and was discarded; the recorded break changes the pinned string itself. The subject was restored byte-identical (git checkout; git diff --name-only prints nothing) and the suite passes again.
  • No network, database or container; no existing test modified or weakened. The file is biome-check clean. The local typecheck reports 19 errors - the pre-existing base of this tree - and 0 mentions of the new file. Verified in-process: the full agent group passes this file next to every suite of this wave (254 pass / 3 fail, the 3 pre-existing local-only env failures, green in CI).
  • Local reproducibility note (issue bun test cannot resolve @/ aliases once .wxt/tsconfig.json exists (wxt prepare output breaks the bun 1.3.6 runtime resolver)Β #1909): bun run typecheck runs wxt prepare, whose generated .wxt/tsconfig.json makes bun 1.3.6 stop resolving @/ aliases for test runs until that generated directory is removed. CI's Tests jobs never run wxt prepare; every run quoted above is from a checkout without .wxt/.

Not verified

  • Nothing beyond the quoted local runs; the CI Tests / agent job re-runs the suite on this SHA.

Dmitrii Fedorov (@dmitrii-f-t27)

@tri-claw

tri-claw Bot commented Oct 14, 2026

Copy link
Copy Markdown

Summary by t27-bees

This PR adds a pin test for the ConnectMCP page component, capturing its initial static render (the "Connected Apps" heading and two "Add" buttons). The test stubs all data seams (MCP server store, mutations, integrations list, remote sync, metrics) so the component mounts without a live document/window, and deliberately excludes the connect flow (auth navigation, API key submission, toasts) which requires browser globals.

Worth a look

  • trios/agent-server/apps/agent/entrypoints/app/connect-mcp/ConnectMCP.test.ts:10 β€” process.env.VITE_BROWSEROS_SERVER_PORT is set before any imports to beat the env module's one-time snapshot. If another test file runs first and imports the env module, this assignment has no effect and the port may differ, potentially altering rendered URLs.
  • trios/agent-server/apps/agent/entrypoints/app/connect-mcp/ConnectMCP.test.ts:12–22 β€” fakeItem returns null for missing keys when no fallback is provided. The mcpServerStorage mock passes { fallback: [] }, but other callers of defineItem (e.g., the graph storage items mocked at line 20) get null instead of their expected defaults, which could hide a crash if the component or a hook reads an uninitialized key.
  • trios/agent-server/apps/agent/entrypoints/app/connect-mcp/ConnectMCP.test.ts:24–30 β€” useMcpServers is mocked to return servers: [] and no-op mutators. If the real hook returns additional fields (e.g., isLoading, error) that the component reads during initial render, the test would not catch the mismatch.
  • trios/agent-server/apps/agent/entrypoints/app/connect-mcp/ConnectMCP.test.ts:49–55 β€” useAddManagedServer.trigger resolves { oauthUrl: null, apiKeyUrl: null }. If the component branches on these values during mount (e.g., shows a loading state when non-null), the test pins a different UI than what a real first mount with pending auth would show.
  • trios/agent-server/apps/agent/entrypoints/app/connect-mcp/ConnectMCP.test.ts:78–80 β€” The test only asserts three static strings via renderToStaticMarkup. It does not verify that the two "Add" buttons are wired to their handlers, that the server list renders when non-empty, or that loading/error states appear. A regression that breaks interactivity but leaves the heading intact would not fail this test.

Read: 1 files, +128 -0, the whole diff. Head a19831b. 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 β€” 3629/3699

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

Copy link
Copy Markdown
Collaborator Author

CI gates on this SHA:

  • Tests / agent: pass β€” the connect-MCP pin runs in the agent group.
  • All other Tests/ matrix jobs pass*, including server-pglive (no flake rerun needed).
  • Typecheck job: 19 errors = the known base count; 0 mentions of ConnectMCP.test.ts in the job log.
  • Biome job: red from base findings; 0 mentions of ConnectMCP.test.ts in the job log.

Dmitrii Fedorov (@dmitrii-f-t27)

@dmitrii-f-t27
dmitrii-f-t27 merged commit ac81d73 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