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

(Fix) Validate whitelist min/max #778

Merged
merged 10 commits into from
Apr 12, 2018
Merged

Conversation

fernandomg
Copy link
Contributor

@fernandomg fernandomg commented Apr 9, 2018

Closes #578

This PR depends on changes made in #767.

  • Validates min/max in whitelist block
  • Validates min/max for bulk upload
  • Changes where made for StepThree and Manage components

Commits made for this PR:

@ghost ghost assigned fernandomg Apr 9, 2018
@ghost ghost added the in progress label Apr 9, 2018
@coveralls
Copy link

coveralls commented Apr 9, 2018

Pull Request Test Coverage Report for Build 1947

  • 8 of 26 (30.77%) changed or added relevant lines in 4 files are covered.
  • 3 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.05%) to 20.044%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/components/manage/index.js 0 1 0.0%
src/components/Common/WhitelistInputBlock.js 0 17 0.0%
Files with Coverage Reduction New Missed Lines %
src/components/manage/index.js 1 0.0%
src/components/Common/WhitelistInputBlock.js 2 17.72%
Totals Coverage Status
Change from base Build 1942: 0.05%
Covered Lines: 556
Relevant Lines: 2421

💛 - Coveralls

@vbaranov
Copy link
Collaborator

@fernandomg please resolve conflicts

@fernandomg
Copy link
Contributor Author

@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)
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

isLessOrEqualThan('Should be less or equal than max')(max)
)(min)

return listOfErrors ? listOfErrors.shift() : ''
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, fixed

@fvictorio fvictorio merged commit 91941fd into master Apr 12, 2018
@fvictorio fvictorio deleted the validate-whitelist-min-max-#578 branch April 12, 2018 14:41
@ghost ghost removed the awaiting for review label Apr 12, 2018
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.

4 participants