-
Notifications
You must be signed in to change notification settings - Fork 215
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
(Fix) Validate whitelist min/max #778
Conversation
Pull Request Test Coverage Report for Build 1947
💛 - Coveralls |
@fernandomg please resolve conflicts |
# Conflicts: # src/utils/validations.js # src/utils/validations.spec.js
@vbaranov done |
@@ -83,7 +83,7 @@ describe('processWhitelist function', () => { | |||
const cb = jest.fn() | |||
|
|||
// When | |||
const { called } = processWhitelist(rows, cb) | |||
const { called } = processWhitelist({ rows, decimals: 3 }, cb) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add some test cases for ignoring invalid decimals, and invalid min/max combinations?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
src/utils/validations.js
Outdated
isLessOrEqualThan('Should be less or equal than max')(max) | ||
)(min) | ||
|
||
return listOfErrors ? listOfErrors.shift() : '' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this return undefined
when there are no errors?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, fixed
Closes #578
This PR depends on changes made in #767.
StepThree
andManage
componentsCommits made for this PR: