Skip to content

test: add unit tests for getValidationModes#12937

Closed
kamja44 wants to merge 1 commit intoreact-hook-form:masterfrom
kamja44:test/get-validation-modes
Closed

test: add unit tests for getValidationModes#12937
kamja44 wants to merge 1 commit intoreact-hook-form:masterfrom
kamja44:test/get-validation-modes

Conversation

@kamja44
Copy link
Copy Markdown
Contributor

@kamja44 kamja44 commented Jul 6, 2025

Adds unit tests for the getValidationModes utility function.

  • Verifies correct boolean flags returned for each VALIDATION_MODE
    • onSubmit
    • onBlur
    • onChange
    • onAll
    • onTouched
  • Also verifies default behavior when mode is undefined
  • Covers all logical branches of the function

This ensures that mode-based validation behavior in React Hook Form is correctly derived from VALIDATION_MODE, and that future regressions in this logic are prevented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant