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
The first suite for apps/agent/entrypoints/sidepanel/index/ConnectAppCard.tsx (ConnectAppCard, the only export), under bun test in the agent group.
describe block: ConnectAppCardTsxContract (appears nowhere else in the tree).
The card dispatches on its position - a last-message nudge opens the choosing card, anything earlier resolves on the spot. The seams are stubbed in the forms this group already carries: the chat-session context, the MCP store in its live-proxy module form, the managed-server and api-key mutations idle, the declined-apps item (WXT #imports virtual module) a plain stand-in, the metrics track a no-op - the api-key dialog the choosing card mounts stays real, closed as it first renders.
Pin: the choosing card answers the connect heading with its reason, the connect button naming the app and the manual button; the resolved card answers the suggested note with the app's name. The oauth round trip, the api-key submission, the manual decline and the completion messages live in handlers needing a live document - per User Story 2.
FR-004 shown both ways, quoted: broken subject (the connect heading reworded) β 0 pass / 1 fail; restored β 1 pass / 0 fail / 6 expect(). git diff --name-only lists only the new test file.
This PR adds a contract test for ConnectAppCard.tsx that pins the current rendering behavior of the connect-app nudge card. The test verifies the card shows the correct heading, reason, and buttons when rendered as a last-message nudge versus an earlier nudge, using stubbed dependencies.
Worth a look
trios/agent-server/apps/agent/entrypoints/sidepanel/index/ConnectAppCard.test.ts:53-65 β The mcpServerStorage mock imports @wxt-dev/storage at call time inside async functions. If that module isn't available or behaves differently in the test environment (e.g., missing defineItem), these mocks will throw at runtime rather than at import time, making failures harder to trace.
trios/agent-server/apps/agent/entrypoints/sidepanel/index/ConnectAppCard.test.ts:105 β The subject is imported via a query-qualified URL (./ConnectAppCard?connect-app-card-suite-real) to force a fresh module instance. This non-standard pattern relies on the bundler/test runner treating each queried URL as a separate entry point; if the tooling ever dedupes by path ignoring the query, the test could share state with other suites unexpectedly.
trios/agent-server/apps/agent/entrypoints/sidepanel/index/ConnectAppCard.test.ts:115 β renderToStaticMarkup produces plain HTML without React internals (no data-reactroot, no event handlers). The test therefore cannot catch missing onClick props, broken button wiring, or client-side hydration mismatches β it only asserts on text content.
trios/agent-server/apps/agent/entrypoints/sidepanel/index/ConnectAppCard.test.ts:121-126 β Assertions check for exact string matches (e.g., 'Connect Notion for better results', 'Track your docs'). Any copy change β including whitespace or punctuation β will fail the suite even if the component's contract (heading, reason, connect button, manual button) is intact.
trios/agent-server/apps/agent/entrypoints/sidepanel/index/ConnectAppCard.test.ts:87-94 β The useAddManagedServer mock returns { oauthUrl: null, apiKeyUrl: null } unconditionally. If the real hook ever returns a truthy oauthUrl or apiKeyUrl for Notion, the component may render an OAuth flow or API-key dialog that this test doesn't exercise, creating a silent coverage gap.
Read: 1 files, +131 -0, the whole diff. Head 5465fd7. 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 #1582
What
The first suite for
apps/agent/entrypoints/sidepanel/index/ConnectAppCard.tsx(ConnectAppCard, the only export), underbun testin the agent group.describeblock:ConnectAppCardTsxContract(appears nowhere else in the tree).#importsvirtual module) a plain stand-in, the metrics track a no-op - the api-key dialog the choosing card mounts stays real, closed as it first renders.0 pass / 1 fail; restored β1 pass / 0 fail / 6 expect().git diff --name-onlylists only the new test file.Local gates
1 pass / 0 fail(6 expect());grep -c 'it('= 1; 1 + 0 blocked = 1.404 pass / 3 fail / 407 testsβ the 3 = the pre-existing port-helper noise, unchanged from baseline.No database, no container, no network.