Skip to content

test(agent): pin the AI settings page - AISettingsPage (Closes #1504) - #2025

Merged
dmitrii-f-t27 merged 1 commit into
queenfrom
zcode-mbp/tests-1504-ai-settings
Oct 15, 2026
Merged

dmitrii-f-t27 merged 1 commit into
queenfrom
zcode-mbp/tests-1504-ai-settings

Conversation

@dmitrii-f-t27

Copy link
Copy Markdown
Collaborator

Closes #1504

What

The first suite for apps/agent/entrypoints/app/ai-settings/AISettingsPage.tsx (AISettingsPage, the only export), under bun test in the agent group β€” unblocked by the shared session-seam repair of #1980.

Local gates

  • Suite: 1 pass / 0 fail (2 expect()); grep -c 'it(' = 1; 1 + 0 blocked = 1.
  • Group (apps/agent): 390 pass / 3 fail / 393 tests β€” the 3 = the pre-existing port-helper noise, unchanged from baseline. The full group with this suite is the direct proof the repair holds: the subject links and renders under the completed facade.
  • Biome: 0. Typecheck: 0 errors / 0 mentions.

No database, no container, no network.

@tri-claw

tri-claw Bot commented Oct 15, 2026

Copy link
Copy Markdown

Summary by t27-bees

This PR adds a contract test for AISettingsPage.tsx that renders the page with all its external seams stubbed, verifying the initial mount shows the framed page with its "LLM Providers" heading. The test was previously blocked by bun's frozen-facade rule on the auth session seam (fixed in #1980).

Worth a look

  • AISettingsPage.test.ts:19-20 β€” process.env.VITE_BROWSEROS_SERVER_PORT ??= '43210' mutates the global process.env before any imports. If another test in the group runs first and reads the env module, the one-time snapshot may capture a different value or the mutation may arrive too late, causing flaky port resolution.
  • AISettingsPage.test.ts:22-35 β€” The values Map is declared at module scope and shared across all tests in the file. With only one test today this is harmless, but any future it block will inherit mutated storage state unless values.clear() is called in a beforeEach.
  • AISettingsPage.test.ts:58-63 β€” The session seam workaround imports the real module via ?ai-settings-real query parameter to bypass bun's facade freeze. This relies on non-standard import specifier behavior; if the bundler or bun changes how query parameters are handled, the spread will fail or pull the wrong module graph.
  • AISettingsPage.test.ts:84-89 β€” Same query-parameter trick for react-router. If react-router doesn't support query-qualified imports, realRouter becomes an empty object and the spread drops all other exports, breaking any component that uses useParams, useLocation, etc.
  • AISettingsPage.test.ts:94-97 β€” The subject import uses ?ai-settings-suite-real to force a fresh module graph. If the component or its transitive dependencies have side effects on import (e.g., registering global listeners), those side effects will run again per test file, potentially leaking across the group.

Read: 1 files, +141 -0, the whole diff. Head 3b34d4d. 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 β€” 3800/3870

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

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