Bug Report
For long-term cycles, the mentee-registration Submit button can silently do nothing: the form fails validation on a field that is not shown on the final step, so no error is displayed.
src/schemas/menteeSchema.ts (superRefine) requires availableHsMonth >= 2 for LONG_TERM (and >= 1 for AD_HOC); the default value is 0.
src/pages/mentorship/mentee-registration.tsx — validateStep1 (the step-1 trigger([...]) list) does not include availableHsMonth, yet the field is rendered on step 1. The final submit uses handleSubmit(onSubmit) with no onInvalid handler.
Reproduction (when IS_ADHOC_CYCLE=false)
- User leaves "Available hours per month" at its default
0 (or enters 1).
- Step 1 passes because
availableHsMonth is not in the step-1 trigger list.
- User reaches the final step and clicks Submit.
- The resolver fails on
availableHsMonth, whose input lives on step 1, so no error renders anywhere — the button appears dead and nothing happens.
Currently dormant because IS_ADHOC_CYCLE=true, but it will affect every long-term cycle.
Severity
High (dormant today; breaks every long-term cycle when ad-hoc mode is off)
Potential Risk
- Mentees silently unable to submit long-term applications, with no visible reason.
Suggested Fix
- Add
availableHsMonth to the step-1 trigger list so it is validated on the step where it is rendered and the error is shown in context.
- Add an
onInvalid handler to handleSubmit that surfaces validation errors (e.g. focuses/scrolls to the first invalid field or shows a summary) so a failed submit is never silent.
- Add a test covering long-term submission with
availableHsMonth below the threshold (expect a visible validation error, not a no-op).
Bug Report
For long-term cycles, the mentee-registration Submit button can silently do nothing: the form fails validation on a field that is not shown on the final step, so no error is displayed.
src/schemas/menteeSchema.ts(superRefine) requiresavailableHsMonth >= 2forLONG_TERM(and>= 1forAD_HOC); the default value is0.src/pages/mentorship/mentee-registration.tsx—validateStep1(the step-1trigger([...])list) does not includeavailableHsMonth, yet the field is rendered on step 1. The final submit useshandleSubmit(onSubmit)with noonInvalidhandler.Reproduction (when
IS_ADHOC_CYCLE=false)0(or enters1).availableHsMonthis not in the step-1 trigger list.availableHsMonth, whose input lives on step 1, so no error renders anywhere — the button appears dead and nothing happens.Currently dormant because
IS_ADHOC_CYCLE=true, but it will affect every long-term cycle.Severity
High (dormant today; breaks every long-term cycle when ad-hoc mode is off)
Potential Risk
Suggested Fix
availableHsMonthto the step-1 trigger list so it is validated on the step where it is rendered and the error is shown in context.onInvalidhandler tohandleSubmitthat surfaces validation errors (e.g. focuses/scrolls to the first invalid field or shows a summary) so a failed submit is never silent.availableHsMonthbelow the threshold (expect a visible validation error, not a no-op).