You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test(agent): pin the MCP server settings card - ServerSettingsCard (Closes #1529) - #1965
One new file: trios/agent-server/apps/agent/entrypoints/app/mcp-settings/ServerSettingsCard.test.ts (the path the issue's Success Criteria names). The subject ServerSettingsCard.tsx is untouched.
The 1 exported symbol is exercised (1 it( block; 0 blocked). The card reads the BrowserOS adapter prefs, the server messaging and the metrics track, so each seam is stubbed with a full stand-in: the adapter (whose real module cannot initialize outside a browser - the complete stand-in this wave's storage suites run with, every consumer-facing method rejecting the way the real one does outside the shell, as a named stub class), the server messaging module (whose real load pulls the extension polyfill, which refuses outside an extension) answering both exports, and the metrics track (a no-op - its real module pulls the adapter graph other suites stub incompletely). Measured, the static render goes through and shows the card as it first mounts: the MCP Server Settings heading with its description, the external-access switch with its label, and the restart control.
Not pinned, and why (issue User Story 2): the settings flow itself - the remote-access toggle with its confirm dialogs, the server restart wait loop, the pref writes - they live in effects and 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 / 4 expect() calls, Ran 1 test across 1 file.
Deliberately broken copy (the card heading changed, valid syntax): 0 pass / 1 fail / 1 expect() calls. 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 (an initial noThisInStatic warning on the stub was resolved by extracting the stub to a named class). 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 (256 pass / 3 fail, the 3 pre-existing local-only env failures, green in CI).
This PR adds a contract test for ServerSettingsCard.tsx that pins its initial static render output. The test stubs three external seams (BrowserOS adapter, server messaging, metrics) and verifies the card shows the heading, description, external-access switch label, and restart button on first mount. Interactive flows (toggle, restart wait loop, pref writes) are intentionally not pinned because they require a live browser environment.
Worth a look
trios/agent-server/apps/agent/entrypoints/app/mcp-settings/ServerSettingsCard.test.ts:15 β process.env.VITE_BROWSEROS_SERVER_PORT is set before the dynamic import to beat the env module's one-time snapshot. If the env module is imported elsewhere in the test setup (e.g., via a shared test helper), this seeding could be too late and the port would fall back to a different value.
trios/agent-server/apps/agent/entrypoints/app/mcp-settings/ServerSettingsCard.test.ts:39-41 β The serverMessages mock returns sendServerMessage: async () => ({ healthy: true }). If the component calls sendServerMessage during render (not just in effects), the resolved value could affect the static markup. The test doesn't assert anything about the health state, so a change in that behavior would go unnoticed.
trios/agent-server/apps/agent/entrypoints/app/mcp-settings/ServerSettingsCard.test.ts:53-60 β The test asserts only the final mounted text content. The suite comment mentions "the loading state answers the skeleton spinner" but no assertion checks for a skeleton/loading UI. If the component initially renders a skeleton that is replaced after data loads, the test would pass even if the skeleton disappeared or changed.
Read: 1 files, +95 -0, the whole diff. Head 48f1927. Model: openai-compatible/nvidia/nemotron-3-ultra-550b-a55b. Commands: @t27-bees review | summary | help | pause | resume. Free for every repository.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1529
What changed
One new file:
trios/agent-server/apps/agent/entrypoints/app/mcp-settings/ServerSettingsCard.test.ts(the path the issue's Success Criteria names). The subjectServerSettingsCard.tsxis untouched.The 1 exported symbol is exercised (1
it(block; 0 blocked). The card reads the BrowserOS adapter prefs, the server messaging and the metrics track, so each seam is stubbed with a full stand-in: the adapter (whose real module cannot initialize outside a browser - the complete stand-in this wave's storage suites run with, every consumer-facing method rejecting the way the real one does outside the shell, as a named stub class), the server messaging module (whose real load pulls the extension polyfill, which refuses outside an extension) answering both exports, and the metrics track (a no-op - its real module pulls the adapter graph other suites stub incompletely). Measured, the static render goes through and shows the card as it first mounts: the MCP Server Settings heading with its description, the external-access switch with its label, and the restart control.Not pinned, and why (issue User Story 2): the settings flow itself - the remote-access toggle with its confirm dialogs, the server restart wait loop, the pref writes - they live in effects and 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)
1 pass / 0 fail / 4 expect() calls, Ran 1 test across 1 file.0 pass / 1 fail / 1 expect() calls. The subject was restored byte-identical (git checkout;git diff --name-onlyprints nothing) and the suite passes again.bun run typecheckrunswxt prepare, whose generated.wxt/tsconfig.jsonmakes bun 1.3.6 stop resolving@/aliases for test runs until that generated directory is removed. CI's Tests jobs never runwxt prepare; every run quoted above is from a checkout without.wxt/.Not verified
Tests / agentjob re-runs the suite on this SHA.Dmitrii Fedorov (@dmitrii-f-t27)