Skip to content

test(agent): pin the connect app card contract - ConnectAppCard - #2030

Closed
dmitrii-f-t27 wants to merge 1 commit into
queenfrom
zcode/tests-1582-connect-app-card
Closed

dmitrii-f-t27 wants to merge 1 commit into
queenfrom
zcode/tests-1582-connect-app-card

Conversation

@dmitrii-f-t27

Copy link
Copy Markdown
Collaborator

Summary

Hold the one export of trios/agent-server/apps/agent/entrypoints/sidepanel/index/ConnectAppCard.tsx β€” ConnectAppCard β€” against its contract (#1582), so the next change to that file has something to fail against.

The card is a phase machine; the static mount pins what it answers today:

  • the last message nudge renders the choosing card: the Connect <app> for better results title, the reason line, the plug icon, and the Connect <app> and Do it manually buttons, with no connecting disable;
  • an earlier message nudge stands resolved: the check mark with the <app> suggested line, and the choosing buttons stay away;
  • a nudge without an app name falls back to App in title and button, and draws no reason line.

Three stub sets ride modules no bun-test run resolves or renders safely: the WXT storage facade, the declined-apps and MCP store items in their live-proxy form, and the chat session context (its real reader throws outside a live session). The dialog kit, the SWR mutation hooks, toast, metrics and sentry stay real β€” a closed Radix dialog mounts nothing in a static render and the hooks are never fired.

Not pinned (issue User Story 2): the connect flow's oauth/api-key dispatch, the manual decline writing the declined list, and the api-key submit live in button handlers needing a live document to press.

Verification

  • bun test entrypoints/sidepanel/index/ConnectAppCard.test.ts β€” 3 pass, 0 fail (14 expect() calls).
  • Broken-copy proof: inverting the phase init (isLastMessage ? 'resolved' : 'choosing') turns all 3 tests red (0 pass, 3 fail); the copy restores clean via git checkout.
  • Mixed-order run with the neighboring suites (entrypoints/sidepanel/, entrypoints/app/connect-mcp/, entrypoints/onboarding/, entrypoints/newtab/, AppSelector, run-result-dialog): all 3 new tests pass alongside the 85 pre-existing tests; the 2 pre-existing failures (missing generated @/generated/graphql/gql, a local-only artifact β€” the CI test job generates it) are identical with and without this suite.
  • biome ci on the suite file: clean. tsgo --noEmit: 0 mentions of the suite file.

Closes #1582

Dmitrii Fedorov (@dmitrii-f-t27)

Hold the one export of entrypoints/sidepanel/index/ConnectAppCard.tsx
against its contract (#1582): the last message nudge
answers the choosing card with its title and reason line, plug icon
and the Connect / Do it manually buttons, an earlier nudge stands
resolved behind the check mark and the suggested line, and a nudge
without an app name falls back to App. The WXT storage facade, the
declined-apps and MCP store items and the chat session context ride
stub modules; the dialog kit and the SWR mutation hooks stay real,
a closed Radix dialog mounting nothing in a static render.

Closes #1582

Dmitrii Fedorov ([@dmitrii-f-t27](https://github.com/dmitrii-f-t27))
@tri-claw

tri-claw Bot commented Oct 15, 2026

Copy link
Copy Markdown

Summary by t27-bees

Worth a look

  • trios/agent-server/apps/agent/entrypoints/sidepanel/index/ConnectAppCard.test.ts:15 β€” The import uses a query-qualified specifier (?connect-app-card-suite-real). This is non-standard and may only work with a specific bundler or test runner configuration; if the build system changes, the import could break silently.
  • trios/agent-server/apps/agent/entrypoints/sidepanel/index/ConnectAppCard.test.ts:23-35 β€” The @wxt-dev/storage mock returns a fallback for getValue but the setValue and watch are no-ops. If the component ever calls these in render (not just handlers), the test won't catch missing behavior.
  • trios/agent-server/apps/agent/entrypoints/sidepanel/index/ConnectAppCard.test.ts:38-62 β€” The mcpServerStorage mock re-imports @wxt-dev/storage at call time. This creates a circular dependency risk if the real module also imports the storage facade; the test may pass while the real app fails at runtime.
  • trios/agent-server/apps/agent/entrypoints/sidepanel/index/ConnectAppCard.test.ts:64-71 β€” declinedAppsStorage is stubbed with a virtual item that always returns null. The component's "Do it manually" handler likely writes to this store; the test doesn't verify that path because it's static, but the stub could mask errors if the handler is ever invoked during render.
  • trios/agent-server/apps/agent/entrypoints/sidepanel/index/ConnectAppCard.test.ts:74-82 β€” The ChatSessionContext mock provides a sendMessage no-op. If the component reads other context values during render (e.g., conversationId for display), the test would miss missing fallbacks.

Read: 1 files, +156 -0, the whole diff. Head 7369e0b. Model: openai-compatible/nvidia/nemotron-3-ultra-550b-a55b. Commands: @t27-bees review | summary | help | pause | resume. Free for every repository.

@dmitrii-f-t27

Copy link
Copy Markdown
Collaborator Author

Duplicate of #2029 (branch zcode-mbp/tests-1582-connect-app-card, already merged into queen), which closed #1582 β€” this batch session raced the parallel one on the same issue. Closing without merge; the suite on queen stands.

@dmitrii-f-t27
dmitrii-f-t27 deleted the zcode/tests-1582-connect-app-card branch October 15, 2026 03:07
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