diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/ng/directive/inputSpec.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/ng/directive/inputSpec.js b/test/ng/directive/inputSpec.js index 4dcb79a3..d69be27c 100644 --- a/test/ng/directive/inputSpec.js +++ b/test/ng/directive/inputSpec.js @@ -476,6 +476,18 @@ describe('input', function() { }); + it('should validate in-lined pattern with modifiers', function() { + compileInput('<input type="text" ng-model="value" ng-pattern="/^abc?$/i" />'); + scope.$digest(); + + changeInputValueTo('aB'); + expect(inputElm).toBeValid(); + + changeInputValueTo('xx'); + expect(inputElm).toBeInvalid(); + }); + + it('should validate pattern from scope', function() { compileInput('<input type="text" ng-model="value" ng-pattern="regexp" />'); scope.regexp = /^\d\d\d-\d\d-\d\d\d\d$/; |
