diff options
| author | Konstantin Stepanov | 2011-10-18 02:18:00 +0300 |
|---|---|---|
| committer | Igor Minar | 2011-10-19 16:49:20 -0700 |
| commit | 78f394fd17be581c84ecd526bb786ed1681d35cb (patch) | |
| tree | 02e07de377903b5b35f76ef1aa7f534b5319d628 /test | |
| parent | e82e64d57b65d9f3c4f2e8831f30b615a069b7f6 (diff) | |
| download | angular.js-78f394fd17be581c84ecd526bb786ed1681d35cb.tar.bz2 | |
feat(input): add ng:minlength and ng:maxlength validation
notes(igor): I also e2e tests and refactorred the e2e test example to be
more clear about what is a variable and what is an html/framework api.
Diffstat (limited to 'test')
| -rw-r--r-- | test/widget/inputSpec.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/widget/inputSpec.js b/test/widget/inputSpec.js index 837d8c83..6524f1e3 100644 --- a/test/widget/inputSpec.js +++ b/test/widget/inputSpec.js @@ -550,6 +550,18 @@ describe('widget: input', function() { }); + itShouldVerify('text with ng:minlength limit', + ['', 'aaa', 'aaaaa', 'aaaaaaaaa'], + ['a', 'aa'], + {'ng:minlength': 3}); + + + itShouldVerify('text with ng:maxlength limit', + ['', 'a', 'aa', 'aaa'], + ['aaaa', 'aaaaa', 'aaaaaaaaa'], + {'ng:maxlength': 3}); + + it('should throw an error when scope pattern can\'t be found', function() { var el = jqLite('<input ng:model="foo" ng:pattern="fooRegexp">'), scope = angular.compile(el)(); |
