k88hudson / react-formation

Robust, testable forms with react in minutes
https://k88hudson.github.io/react-formation
33 stars 9 forks source link

Validitor returning false for valid is weird #15

Closed k88hudson closed 8 years ago

k88hudson commented 9 years ago

Maybe we should return true instead and check for === true instead?

pippinlee commented 9 years ago

Initial feelings when dealing with valid/invalid options while updating Validator.test.js totally agree with this. We now have the valid and invalid keys in there to help make this a bit clearer.

If I'm reading this correctly -- looks like Validator.prototype.assert in Validator.js can be updated to make it so that we're returning true like you've mentioned above.

https://github.com/k88hudson/react-formation/blob/master/src/lib/Validator.js#L154

Looks like we'll also need to update CreateFormMixin.js per current API docs:

https://github.com/k88hudson/react-formation/blob/master/src/lib/apiDocs/submitGroup.md