Skip to content

test(agent): pin the profile page - ProfilePage (Closes #1523) - #2027

Merged
dmitrii-f-t27 merged 1 commit into
queenfrom
zcode-mbp/tests-1523-profile-page
Oct 15, 2026
Merged

dmitrii-f-t27 merged 1 commit into
queenfrom
zcode-mbp/tests-1523-profile-page

Conversation

@dmitrii-f-t27

Copy link
Copy Markdown
Collaborator

Closes #1523

What

The first suite for apps/agent/entrypoints/app/profile/ProfilePage.tsx (ProfilePage, the only export), under bun test in the agent group β€” the second subject unblocked by the shared session-seam repair of #1980 (this page statically imports useSessionInfo, the import the frozen facade used to starve).

  • describe block: ProfilePageTsxContract (appears nowhere else in the tree).
  • The suite drives the two hooks the page reads - the session seam through a mutable holder answering signed-out and signed-in states, the profile query through a holder answering the loaded profile - inside a real memory router and query client provider, with the update mutation stubbed idle; the form machinery with its zod resolver and the card kits stay real. Pin: the signed-out mount answers only its spinner - no profile card; the signed-in loaded mount answers the update-profile card with its title and description (the profile's names reach the form fields through a reset effect a static render never runs - noted in the suite header).
  • The update flow - the mutation and its success note, the avatar upload with its size guard, the names reset - lives in handlers and effects needing a live document; per User Story 2.
  • FR-004 shown both ways, quoted: broken subject (the card title relabelled) β†’ 0 pass / 1 fail; restored β†’ 1 pass / 0 fail / 4 expect(). git diff --name-only lists only the new test file.

Local gates

  • Suite: 1 pass / 0 fail (4 expect()); grep -c 'it(' = 1; 1 + 0 blocked = 1.
  • Group (apps/agent): 403 pass / 3 fail / 406 tests β€” the 3 = the pre-existing port-helper noise, unchanged from baseline.
  • 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

Adds a contract test for ProfilePage.tsx that pins its current render behavior: signed-out shows only a spinner, signed-in shows the update-profile card with title and description. The test works around the frozen session facade by mocking the session and profile hooks with mutable holders, and uses a query-qualified import to get fresh module instances.

Worth a look

  • ProfilePage.test.ts:27–29 β€” Module-level process.env.VITE_BROWSEROS_SERVER_PORT ??= '43210' mutates the global process env before any imports; if other test files in the same bun process run after this, they'll inherit the value unless they explicitly override it.
  • ProfilePage.test.ts:31–32, 37–38 β€” sessionState and profileState are module-scoped mutable objects shared across all tests in the file; adding a second it block would see the signed-in state left by the first, causing flaky ordering-dependent failures.
  • ProfilePage.test.ts:70 β€” The query-qualified import ./ProfilePage?profile-page-suite-real relies on Vite/bun's query-string cache-busting for modules; if the test runner changes how it handles import specifiers, the fresh-instance guarantee could break silently.
  • ProfilePage.test.ts:86 β€” renderToStaticMarkup doesn't run React effects, so the form-field reset effect (which populates first/last name) is explicitly not exercised; the test only asserts on static card markup.
  • ProfilePage.test.ts:55–59 β€” The useGraphqlMutation mock returns an idle mutate; the update flow (mutation, avatar upload, validation, reset) is intentionally unpinned per User Story 2, but any future change that adds a mutate call during render would silently no-op.

Read: 1 files, +125 -0, the whole diff. Head c38c371. 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 β€” 3808/3878

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

@dmitrii-f-t27
dmitrii-f-t27 merged commit df907af into queen Oct 15, 2026
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