diff options
| author | Mark Nadig | 2013-03-05 10:43:06 -0700 |
|---|---|---|
| committer | Pawel Kozlowski | 2013-03-08 21:56:32 +0100 |
| commit | f20646bce5f0c914992a78fc2556bda136c27ac9 (patch) | |
| tree | 41884f1f286a5a118092c03414a67b91f45f9a74 /test/ng | |
| parent | 65e57a7c3d53fad536797301fe59b5912ed4db16 (diff) | |
| download | angular.js-f20646bce5f0c914992a78fc2556bda136c27ac9.tar.bz2 | |
feat(directive): add ngKeypress directive for handling keypress event
Diffstat (limited to 'test/ng')
| -rw-r--r-- | test/ng/directive/ngKeySpec.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/ng/directive/ngKeySpec.js b/test/ng/directive/ngKeySpec.js index d8c6f9de..c7b989a4 100644 --- a/test/ng/directive/ngKeySpec.js +++ b/test/ng/directive/ngKeySpec.js @@ -25,5 +25,14 @@ describe('ngKeyup and ngKeydown directives', function() { expect($rootScope.touched).toEqual(true); })); + it('should get called on a keypress', inject(function($rootScope, $compile) { + element = $compile('<input ng-keypress="touched = true">')($rootScope); + $rootScope.$digest(); + expect($rootScope.touched).toBeFalsy(); + + browserTrigger(element, 'keypress'); + expect($rootScope.touched).toEqual(true); + })); + }); |
