Fix deterministic caring-contact time test - #2465
Conversation
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
|
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: Pro Plus 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. |
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_81b19768-4247-47da-80a8-c5ec4cbc9238) |
Summary
input[type="time"]paths with the completed browserchangeevent.tests/caring-contacts-contact-time-adjustment.dom.test.tsx.Verification
npm run verify:pr-local— not run locally because the one-file test-only scope is covered by the focused DOM suite and the authoritative hosted Unit coverage job will run on this PR.GATE_RECEIPTS=off npx vitest run tests/caring-contacts-contact-time-adjustment.dom.test.tsx --reporter=dot— 17 passed, repeated three consecutive times.npx prettier --check tests/caring-contacts-contact-time-adjustment.dom.test.tsx— all matched files use Prettier code style.npx eslint tests/caring-contacts-contact-time-adjustment.dom.test.tsx— clean.Risk and rollout
Clinical Governance Preflight
Not applicable: no clinical behaviour, content, retrieval, privacy, ingestion, source rendering, or production environment code changed.
Notes
The current-main reproduction showed the failing time field was
""afteruserEvent.type; the production component itself has no system-clock read. This follows the repository's existing controlled date-input precedent: jsdom sanitises partial date/time values, while the browser delivers one completed change from the native control.Note
Low Risk
Test-only event simulation in one DOM test file; no runtime, auth, or data-path changes.
Overview
Fixes non-deterministic failures in
tests/caring-contacts-contact-time-adjustment.dom.test.tsxwhen tests setinput[type="time"]to completed values like15:45or18:00.In three scenarios (second move on the same screen, version-refusal after a first move, and the outside-window boundary at 18:00),
userEvent.clear+userEvent.typeis replaced withfireEvent.changeso jsdom receives a single completed value instead of partial keystrokes that the time control sanitises to"". The first move in each flow still usesuserEventwhere it already passed; only the repeated controlled-time paths change. A short comment documents the jsdom vs browser behaviour for the 18:00 case.Imports
fireEventfrom Testing Library. No application or production code is touched.Reviewed by Cursor Bugbot for commit 7912604. Configure here.