Permalink
Browse files

Add 100% test coverage and coveralls

  • Loading branch information...
zackify committed Aug 8, 2017
1 parent c3406c4 commit 2499a88878ab5a667c1b05d4ba1312af9af5be66
Showing with 475 additions and 6 deletions.
  1. +1 −0 README.md
  2. +3 −0 circle.yml
  3. +3 −2 form.js
  4. +246 −1 package-lock.json
  5. +6 −3 package.json
  6. +16 −0 tests/children.js
  7. +19 −0 tests/errors.js
  8. +29 −0 tests/initial-values.js
  9. +90 −0 tests/inputs.js
  10. +62 −0 tests/submit.js
View
@@ -1,5 +1,6 @@
## React Validify
[![CircleCI](https://circleci.com/gh/navjobs/validify.svg?style=svg)](https://circleci.com/gh/navjobs/validify)
[![Coverage Status](https://coveralls.io/repos/github/navjobs/validify/badge.svg?branch=master)](https://coveralls.io/github/navjobs/validify?branch=master)
### Todo
View
@@ -1,3 +1,6 @@
machine:
node:
version: 8.2.1
test:
override:
- npm run test-ci
View
@@ -12,7 +12,7 @@ export default class Form extends React.Component {
componentWillReceiveProps({ errors, initialValues }) {
if (initialValues !== this.props.initialValues)
this.setState({ initialValues });
this.setState({ values: initialValues });
if (errors !== this.props.errors) this.setState({ errors });
}
@@ -44,8 +44,9 @@ export default class Form extends React.Component {
if (runner.fails() && values[name]) {
return this.setState({ errors: { ...errors, ...runner.errors.errors } });
}
if (errors[name])
if (errors[name]) {
return this.setState({ errors: { ...errors, [name]: null } });
}
}
onChange({ target }) {
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
Oops, something went wrong.

0 comments on commit 2499a88

Please sign in to comment.