Skip to content

Commit

Permalink
D-16638: Better error message (Lauren Approved)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jigarsolanki committed Dec 30, 2013
1 parent 8076e86 commit 183861f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion spec/validators/min-length-validaor-spec.js
Expand Up @@ -22,7 +22,7 @@ describe('ko.validators.minLengthValidator', function() {

it('should have correct message on failure', function() {
result = validator.validate('no');
expect(result.message).toBe('Field must be atleast 3 characters long.');
expect(result.message).toBe('Field must be at least 3 characters.');
});

This comment has been minimized.

Copy link
@laurenpuckett

laurenpuckett Dec 30, 2013

Will this grab the label from the field? If not, we may need to say "[Field] must contain at least 3 characters", to cover a bigger variety of labels.

This comment has been minimized.

Copy link
@Jigarsolanki

Jigarsolanki Dec 30, 2013

Author Contributor

Okay I will change that in next PR

});

2 changes: 1 addition & 1 deletion src/validators/min-length-validator.js
Expand Up @@ -7,7 +7,7 @@ ko.validators.minLengthValidator = function (fieldName, length) {
return value.toString().trim().length >= length;
},
utils.buildString(
'{$field} must be atleast {$len} characters long.',
'{$field} must be at least {$len} characters.',
{ 'field' : fieldName, 'len' : length }
)
)
Expand Down

0 comments on commit 183861f

Please sign in to comment.