Skip to content
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

Add more tests for validateIfNeeded & warnIfNeeded #2450

Conversation

timhwang21
Copy link
Contributor

References #2431.

  • Added warnIfNeeded() tests based on validateIfNeeded()
  • Added a test to check if values and props are correctly passed to validate & warn

I'm not sure my method for checking props is the most elegant (spying on the props passed to shouldValidate and comparing with the argument of validate with Object.keys()) but I couldn't find a state where the props had the exact same values as well.

Let me know if I missed anything, thanks!

* Copied validateIfNeeded tests for warnIfNeeded
* Added a test to check if values and props are
  correctly passed to validate & warn
@erikras erikras merged commit d3f5146 into redux-form:master Jan 12, 2017
@erikras
Copy link
Member

erikras commented Jan 12, 2017

Great! 👍

selvagsz added a commit to selvagsz/redux-form that referenced this pull request Feb 6, 2017
* redux-form/master: (61 commits)
  Exported getFormNames (redux-form#2519)
  v6.5.0
  Do not set FieldArray as touched on submit, as it causes its entry in storeState.fields to become an object instead of an array. The ARRAY_* reducers expects the fields entry to be an array. Fixes redux-form#2014. (redux-form#2473)
  Chore/switch shallowequal to lodash isequalwith (redux-form#2506)
  Keep track of registration count in registeredFields (redux-form#2470)
  fix: when the Field type is "file", value can not be updated (redux-form#2452)
  Remove undocumented name, validate and warn from FieldArray props. (redux-form#2467)
  Clarify what to do when StackOverflow questions get no answers (redux-form#2497)
  Excluded tests from code climate
  Enable Code Climate (redux-form#2486)
  Update ConnectedFields cached handlers when names prop changes. Fixes bug introduced by redux-form#2161. (redux-form#2474)
  Breaking change: Change Fields names instance API to return FormSection prefixed names, to be consistent with Field and FieldArray. (redux-form#2464)
  Add initial value selector (redux-form#2460)
  Add more tests for validateIfNeeded & warnIfNeeded (redux-form#2450)
  Provide validation functions with access to form props (redux-form#2431)
  feat(initialize): add keepSubmitSucceeded option (redux-form#2426)
  Synced Immutable and plain exports (+ tests) (redux-form#2425)
  Choose getIn based off Iterable.isIterable() (redux-form#2423)
  Fixed redux-form#2444 unexpected value updates when radio lose focus (redux-form#2445)
  Beerpay badge
  ...
@timhwang21 timhwang21 deleted the thwang/add-validateIfNeeded-warnIfNeeded-tests branch June 10, 2017 19:27
@lock
Copy link

lock bot commented Jun 1, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 1, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants