Skip to content

Added unit tests for invalid types in User-Id validation. #90

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

Merged
merged 2 commits into from
Apr 18, 2018

Conversation

mfahadahmed
Copy link
Contributor

No description provided.

@@ -45,6 +45,24 @@ describe('lib/utils/user_id_validator', function() {
userIdValidator.validate('');
Copy link
Contributor

Choose a reason for hiding this comment

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

Please update the license headers to include the year 2018 --> 2016, 2018

@@ -45,6 +45,24 @@ describe('lib/utils/user_id_validator', function() {
userIdValidator.validate('');
}, sprintf(ERROR_MESSAGES.INVALID_USER_ID, 'USER_ID_VALIDATOR'));
});

it('should throw an error if userId is int', function() {
Copy link
Contributor

Choose a reason for hiding this comment

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

These can be consolidated into one test case, which is, should throw an error if userId is not a string and you can run the 3 assertions in that one test

Copy link
Contributor

@mikeproeng37 mikeproeng37 left a comment

Choose a reason for hiding this comment

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

lgtm

@mikeproeng37 mikeproeng37 merged commit d9c5ada into master Apr 18, 2018
@mikeproeng37 mikeproeng37 deleted the fahad/userid-validator-tests branch September 7, 2018 22:41
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.

2 participants