Repository navigation
Add dob limit - #1821
Open
david-roper wants to merge 2 commits into
Open
Add dob limit#1821david-roper wants to merge 2 commits into
david-roper wants to merge 2 commits into
Conversation
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
The Start Session form now rejects a subject date of birth in the future.
Until now, any date was accepted, so a typo such as
2062instead of1962started a session and stored an impossible birth date on the subject. The date of birth field now shows "Date of birth must be in the past" and the form won't submit until it's corrected.minimumAgeset is unchanged and still runs after this one.Changes
apps/web/src/components/StartSessionForm/StartSessionForm.tsxsubjectDateOfBirthgets.max(currentDate, …)with the translated message.apps/web/src/components/StartSessionForm/__tests__/StartSessionForm.test.tsxtesting/src/specs/start-session.spec.tstesting/src/pages/_app/session/start-session.page.tsfillDateOfBirth(date). It fills the date and then blurs the input, because libui's date input only commits typed text when it loses focus.Test plan
pnpm lintpasses forwebandtestingStartSessionForm.test.tsxpasses (29 tests)start-session.spec.tspasses in Chromium (28 tests)pnpm test:coverageandpnpm test:e2eNotes for reviewers
fillSubjectDetails()page-object helper fills the date of birth and then selects the sex, without blurring the date input in between. Its date is therefore probably never committed. The tests using it pass anyway because date of birth is optional with a custom ID. A follow-up could switch it tofillDateOfBirth(); this PR leaves it alone to stay small.timeoutintesting/playwright.config.ts, so e2e runs can fail before any test starts. That's unrelated to this change and isn't touched here.🤖 Generated with Claude Code
Closes issue #1820