Skip to content

test(agent): pin the tab picker popover - TabPickerPopover (Closes #1535) - #1966

Merged
dmitrii-f-t27 merged 1 commit into
queenfrom
zcode-mbp/tests-1535-tab-picker
Oct 14, 2026
Merged

dmitrii-f-t27 merged 1 commit into
queenfrom
zcode-mbp/tests-1535-tab-picker

Conversation

@dmitrii-f-t27

Copy link
Copy Markdown
Collaborator

Closes #1535

What changed

One new file: trios/agent-server/apps/agent/components/elements/tab-picker-popover.test.ts (the path the issue's Success Criteria names). The subject tab-picker-popover.tsx is untouched.

The 1 exported symbol is exercised (1 it( block; 0 blocked). The picker reads the browser's tab list through useAvailableTabs, so that seam is stubbed with a full stand-in - every field the picker destructures (the filtered tabs, the whole list and the loading flag), the chrome query never running in its effect. Radix portals never flush through a static render, so the popover kit is stubbed with a portal-free stand-in that keeps the real kit's contract for the pieces the picker reads: the trigger always renders, the content only while open (the flag passed down through a closure the factories of one render share). Measured, the pins read both variants the export dispatches on: the mention variant renders nothing while closed, and while open answers the tab list - the header with its filter hint, and the tab titles with their URLs; the selector variant answers its trigger with the children handed in.

Not pinned, and why (issue User Story 2): the picking flow itself - the keyboard navigation, the tab toggling, the scroll into view - they live in handlers and effects 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 / 7 expect() calls, Ran 1 test across 1 file.
  • Deliberately broken copy (the list header changed, valid syntax): 0 pass / 1 fail / 2 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. 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 - this run went fully green (260 pass / 0 fail, the usual three local-only env failures passing in this order).
  • 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 TabPickerPopover that captures its current static rendering behavior for both mention and selector variants. The test stubs useAvailableTabs and Radix popover portals to work under renderToStaticMarkup.

Worth a look

  • trios/agent-server/apps/agent/components/elements/tab-picker-popover.test.ts:38 β€” Module-level let popoverOpen = false is mutated by the Popover mock factory. If the test runner ever executes tests in parallel or adds more it blocks that render the popover, this shared flag will leak state between renders. A closure-scoped or per-render flag would be safer.
  • trios/agent-server/apps/agent/components/elements/tab-picker-popover.test.ts:96 β€” The anchorRef is cast through unknown to satisfy the ref type. If the component ever accesses anchorRef.current during static render (it doesn't today), this would throw.
  • trios/agent-server/apps/agent/components/elements/tab-picker-popover.test.ts:54–60 β€” The useAvailableTabs stub returns allTabs with a missing protocol on the second URL ('mail.example.com' vs 'https://docs.example.com'). If the component ever validates or normalizes URLs, this inconsistency could mask or trigger a bug.
  • trios/agent-server/apps/agent/components/elements/tab-picker-popover.test.ts:30 β€” process.env.VITE_BROWSEROS_SERVER_PORT is set before imports to beat the env module's one-time snapshot. This works because the test file is the entry point, but any future test that imports this file after the env module has initialized will see a stale value.

Read: 1 files, +127 -0, the whole diff. Head f04d1c2. 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 β€” 3632/3702

Suite Passed Failed Skipped
βœ… agent 260/260 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 tab-picker 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 tab-picker-popover.test.ts in the job log.
  • Biome job: red from base findings; 0 mentions of tab-picker-popover.test.ts in the job log.

Dmitrii Fedorov (@dmitrii-f-t27)

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