-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: Outstanding List component validation tests #3323
Conversation
Removed vultr server and associated DNS entries |
@@ -16,6 +15,7 @@ import { DESCRIPTION_TEXT, ERROR_MESSAGE } from "../../shared/constants"; | |||
import BasicRadio from "../../shared/Radio/BasicRadio"; | |||
import type { NumberField, QuestionField, TextField } from "../model"; | |||
import { useListContext } from "./Context"; | |||
import { get } from "lodash"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change was required as the formik's getIn()
doesn't correctly handle fn
fields using dot notation (e.g. proposal.propertyType
).
Docs: https://formik.org/docs/api/fieldarray#fieldarray-validation-gotchas
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡
bfc8f5a
to
4f6287a
Compare
// Do not allow new item to be added if it will exceed max | ||
if (schema.max && formik.values.userData.length === schema.max) { | ||
return setMaxError(true); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moving this here feels like a better user experience than just checking this when a user hits "Continue" (and may have added too many items).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Meaningful coverage here 💯
4f6287a
to
6d75bb7
Compare
6d75bb7
to
770d301
Compare
What does this PR do?
test.todo()
s following on from feat: List component - form validation and values #3217ChecklistFieldInput
for List component #3304 (dependant on merge order)