aboutsummaryrefslogtreecommitdiffstats
path: root/test/widget/inputSpec.js
diff options
context:
space:
mode:
authorKonstantin Stepanov2011-10-18 02:18:00 +0300
committerIgor Minar2011-10-19 16:49:20 -0700
commit78f394fd17be581c84ecd526bb786ed1681d35cb (patch)
tree02e07de377903b5b35f76ef1aa7f534b5319d628 /test/widget/inputSpec.js
parente82e64d57b65d9f3c4f2e8831f30b615a069b7f6 (diff)
downloadangular.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/widget/inputSpec.js')
-rw-r--r--test/widget/inputSpec.js12
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)();