Repository navigation
refactor(groupwizard): drop unreachable empty-fields branch in handleNext - #51
Merged
chriskehayias merged 1 commit intoOct 10, 2026
Merged
Conversation
…Next The `!fields || fields.length === 0` special case could never run: only the Review step has an empty STEP_FIELDS entry, and Review shows Submit, not Next. form.trigger([]) resolves true with the zod resolver anyway, and a missing entry (undefined) validates the whole form, so calling trigger unconditionally fails safe. Adds a schema test pinning that every step before Review lists fields. group-wizard.tsx is now 100% statements. Closes the 2026-09-13 dead-empty-fields-branch-handlenext TODO. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
chriskehayias
deleted the
refactor/groupwizard-drop-dead-empty-fields-branch
branch
October 10, 2026 15:53
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
!fields || fields.length === 0special case fromGroupWizard.handleNext. Only the Review step'sSTEP_FIELDSentry is empty, and Review renders Submit (handleSubmit), never Next, so the branch could not run.handleNextnow always callsform.trigger(STEP_FIELDS[currentStep]). In react-hook-form 7.89 with a resolver,trigger([])resolvestrueand updates no field errors. A missing entry (undefined) validates the whole form, so a future misconfiguration fails safe instead of skipping validation.schema.test.tscase:STEP_FIELDShas an entry perWIZARD_STEPS, every step before Review lists fields, and only Review is empty.group-wizard.tsxgoes from 94.5% to 100% statements. Deleted the closed TODO and updatedINDEX.md.Test plan
npm run lintnpm run typechecknpm run test:coverage(2097 passed)🤖 Generated with Claude Code