Skip to content

test(caring-contacts): stabilize shell hydration races and duplicate testids - #2743

Closed
BigSimmo wants to merge 1 commit into
mainfrom
task/caring-contacts-shell-stabilization
Closed

test(caring-contacts): stabilize shell hydration races and duplicate testids#2743
BigSimmo wants to merge 1 commit into
mainfrom
task/caring-contacts-shell-stabilization

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Sep 8, 2026

Copy link
Copy Markdown
Owner

Summary

Resolves #2NRB8V, #57QDCS, #XXH42K, #NHGFXR, #1BHXEF, #QX7TP2, #JZA0XK

Resolves 7 testid duplication, Suspense hydration race, and test-flakiness issues in Caring Contacts to make workspace and advisory tests fully deterministic:

  • #2NRB8V (P3): Scoped 3 caring-contacts-guidance assertions in tests/ui-caring-contacts-workspace.spec.ts to the active boundary section (page.getByRole("main").locator("section[aria-labelledby='caring-contacts-guidance-boundary']")), preventing strict-mode collisions during lazy shell placement.
  • #57QDCS (P3): Added isMountedRef unmount tracking and async state guards in src/components/caring-contacts/workspace/plan-wizard/plan-wizard.tsx; scoped reload draft test in tests/ui-caring-contacts-activation.spec.ts to :visible to ignore streamed Suspense S: clones.
  • #XXH42K (P2): Settled openWorkspace() helper in tests/ui-caring-contacts-workspace.spec.ts using expect.poll to wait for both caring-contacts-rail and caring-contacts-phone-dock count to settle to [1, 1] simultaneously.
  • #NHGFXR (P2): Added custom testId prop defaulting to "caring-contacts-synthetic-marker" in src/components/caring-contacts/workspace/synthetic-marker.tsx, and passed testId="caring-contacts-loading-synthetic-marker" in src/app/caring-contacts/loading.tsx to prevent duplicate testids during Suspense streaming.
  • #1BHXEF (P3): Hardened demo clock mockup test in tests/ui-ward-roles.spec.ts by invoking await page.clock.pauseAt(new Date("2026-08-26T10:00:00Z")) to freeze virtual clock ticks across user interactions.
  • #QX7TP2 (P3): Added exhaustive unit test suite in tests/caring-contacts-wizard.test.ts covering the plan wizard stage transition matrix, definitions, implementations, and traversal helpers (10 passing tests).
  • #JZA0XK (P2): Added browser assertions in tests/ui-caring-contacts-activation.spec.ts asserting disabled controls during in-flight activation and idempotent handling in the created-not-started two-write middle state.
  • Queued ledger inbox done requests in docs/outstanding-issues-inbox/ for all 7 issues.

Verification

  • npx vitest run tests/caring-contacts-wizard.test.ts tests/caring-contacts-workspace-shell.dom.test.tsx (2 passed, 28/28 passed)
  • npm run test:cc-guards (42 passed, 1069/1069 passed, gate receipts recorded pass)
  • npm run check:ledger-write-discipline (passed for 35f600c..HEAD)
  • node scripts/ledger-inbox.mjs check (passed: 49 pending requests, 1080 applied)
  • npm run typecheck (passed, exit code 0)
  • npm run format (passed, Prettier formatted all files clean)

Risk and rollout

  • Risk: Low — localized to Caring Contacts test locators, stage transition unit tests, Suspense loading markers, and clock pause in ward role tests.
  • Rollback: Revert commit.
  • Provider or production effects: None.
  • RAG impact: none

Note

Low Risk
Changes are mostly test locators and guards; the only runtime behavior change is unmount-safe submission state updates in PlanWizard, with no auth or data-path impact.

Overview
Hardens Caring Contacts E2E and unit coverage against Suspense streaming, strict-mode collisions, and async wizard races, and records seven resolved issues in docs/outstanding-issues-inbox/.

Test stability: openWorkspace now uses expect.poll until both caring-contacts-rail and caring-contacts-phone-dock each have count 1. Guidance assertions target mainsection[aria-labelledby='caring-contacts-guidance-boundary'] instead of a shared test id. The activation spec scopes the post-reload wizard to :visible, delays the activation route to assert disabled overlay controls while create/activate is in flight, and the ward demo clock test calls pauseAt after clock.install.

Product tweaks for tests: SyntheticMarker accepts an optional testId (loading uses caring-contacts-loading-synthetic-marker). PlanWizard guards post-fetch setSubmissionState and navigation with isMountedRef.

New coverage: tests/caring-contacts-wizard.test.ts pins the plan wizard stage order, labels, and next/previous helpers.

Reviewed by Cursor Bugbot for commit eb78c46. Configure here.

…testids

Resolves #2NRB8V, #57QDCS, #XXH42K, #NHGFXR, #1BHXEF, #QX7TP2, #JZA0XK

- #2NRB8V: Scope three caring-contacts-guidance assertions in tests/ui-caring-contacts-workspace.spec.ts to the active boundary section (section[aria-labelledby='caring-contacts-guidance-boundary'])
- #57QDCS: Add isMountedRef unmount tracking and async state guard in PlanWizard; scope reload draft test in tests/ui-caring-contacts-activation.spec.ts to :visible
- #XXH42K: Settle openWorkspace helper in tests/ui-caring-contacts-workspace.spec.ts using expect.poll to wait for both caring-contacts-rail and caring-contacts-phone-dock simultaneously
- #NHGFXR: Differentiate loading synthetic marker testId ('caring-contacts-loading-synthetic-marker') in src/app/caring-contacts/loading.tsx and src/components/caring-contacts/workspace/synthetic-marker.tsx
- #1BHXEF: Freeze demo clock mockup test in tests/ui-ward-roles.spec.ts using page.clock.pauseAt(new Date('2026-08-26T10:00:00Z'))
- #QX7TP2: Add unit test suite in tests/caring-contacts-wizard.test.ts covering the plan wizard stage transition matrix, definitions, implementations, and traversal helpers
- #JZA0XK: Add browser assertions in tests/ui-caring-contacts-activation.spec.ts verifying disabled submission controls during in-flight activation and idempotent handling in the created-not-started two-write middle state
- Queue ledger inbox done requests for all 7 issues
@coderabbitai

coderabbitai Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: dcacd522-ac48-4e19-8bce-e5c38d4259f8


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 8, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-08T13:50:38.508765Z eb78c46 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@supabase

supabase Bot commented Sep 8, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project sjrfecxgysukkwxsowpy because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@cursor

cursor Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_b1241985-f1d0-408e-86e8-0d87220b8ce1)

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

CI triage

CI failed on this PR. Automated classification of the 2 failed job(s):

  • Production UI (1)not baselined: this job did NOT run on the main comparison below (path-scoped skip), so that run says nothing about it either way. Treat the comparison as absent, not green, and inspect the failing step.
  • PR requiredneeds investigation: inspect the failing step and uploaded diagnostics; rerun only after classifying the cause.

Compared with main CI run #16407 (failure). That run's conclusion is an aggregate and did not exercise Production UI (1).

Classification is evidence routing, not permission to ignore a failure. Exact quarantined Playwright identities remain governed by the flake ledger.

@BigSimmo

Copy link
Copy Markdown
Owner Author

Consolidated into #2705 at 6b9d31a. The complete original head eb78c46 is retained as an ancestor, including its code, tests and audit requests. Closing this duplicate review/CI stream under the authorised consolidation; source branch retained. Current verification and remaining merge prerequisites are recorded on #2705. This closure does not claim that the successor is merged or that its required CI is green.

@BigSimmo BigSimmo closed this Sep 10, 2026
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