test(caring-contacts): stabilize shell hydration races and duplicate testids - #2743
test(caring-contacts): stabilize shell hydration races and duplicate testids#2743BigSimmo wants to merge 1 commit into
Conversation
…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
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 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. Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
Bugbot couldn't run - usage limit reachedBugbot 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) |
CI triageCI failed on this PR. Automated classification of the 2 failed job(s):
Compared with main CI run #16407 (failure). That run's conclusion is an aggregate and did not exercise Classification is evidence routing, not permission to ignore a failure. Exact quarantined Playwright identities remain governed by the flake ledger. |
|
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. |
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:
tests/ui-caring-contacts-workspace.spec.tsto the active boundary section (page.getByRole("main").locator("section[aria-labelledby='caring-contacts-guidance-boundary']")), preventing strict-mode collisions during lazy shell placement.isMountedRefunmount tracking and async state guards insrc/components/caring-contacts/workspace/plan-wizard/plan-wizard.tsx; scoped reload draft test intests/ui-caring-contacts-activation.spec.tsto:visibleto ignore streamed SuspenseS:clones.openWorkspace()helper intests/ui-caring-contacts-workspace.spec.tsusingexpect.pollto wait for bothcaring-contacts-railandcaring-contacts-phone-dockcount to settle to[1, 1]simultaneously.testIdprop defaulting to"caring-contacts-synthetic-marker"insrc/components/caring-contacts/workspace/synthetic-marker.tsx, and passedtestId="caring-contacts-loading-synthetic-marker"insrc/app/caring-contacts/loading.tsxto prevent duplicate testids during Suspense streaming.tests/ui-ward-roles.spec.tsby invokingawait page.clock.pauseAt(new Date("2026-08-26T10:00:00Z"))to freeze virtual clock ticks across user interactions.tests/caring-contacts-wizard.test.tscovering the plan wizard stage transition matrix, definitions, implementations, and traversal helpers (10 passing tests).tests/ui-caring-contacts-activation.spec.tsasserting disabled controls during in-flight activation and idempotent handling in the created-not-started two-write middle state.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
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:
openWorkspacenow usesexpect.polluntil bothcaring-contacts-railandcaring-contacts-phone-dockeach have count 1. Guidance assertions targetmain→section[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 callspauseAtafterclock.install.Product tweaks for tests:
SyntheticMarkeraccepts an optionaltestId(loading usescaring-contacts-loading-synthetic-marker).PlanWizardguards post-fetchsetSubmissionStateand navigation withisMountedRef.New coverage:
tests/caring-contacts-wizard.test.tspins the plan wizard stage order, labels, and next/previous helpers.Reviewed by Cursor Bugbot for commit eb78c46. Configure here.