'use strict'; describe('ngKeyup and ngKeydown directives', function() { var element; afterEach(function() { dealoc(element); }); it('should get called on a keyup', inject(function($rootScope, $compile) { element = $compile('')($rootScope); $rootScope.$digest(); expect($rootScope.touched).toBeFalsy(); browserTrigger(element, 'keyup'); expect($rootScope.touched).toEqual(true); })); it('should get called on a keydown', inject(function($rootScope, $compile) { element = $compile('')($rootScope); $rootScope.$digest(); expect($rootScope.touched).toBeFalsy(); browserTrigger(element, 'keydown'); expect($rootScope.touched).toEqual(true); })); it('should get called on a keypress', inject(function($rootScope, $compile) { element = $compile('')($rootScope); $rootScope.$digest(); expect($rootScope.touched).toBeFalsy(); browserTrigger(element, 'keypress'); expect($rootScope.touched).toEqual(true); })); it('should get called on focus', inject(function($rootScope, $compile) { element = $compile('')($rootScope); $rootScope.$digest(); expect($rootScope.touched).toBeFalsy(); browserTrigger(element, 'focus'); expect($rootScope.touched).toEqual(true); })); it('should get called on blur', inject(function($rootScope, $compile) { element = $compile('')($rootScope); $rootScope.$digest(); expect($rootScope.touched).toBeFalsy(); browserTrigger(element, 'blur'); expect($rootScope.touched).toEqual(true); })); }); f25aaa7f054a91ac9eb6468f49fc'>treecommitdiffstats
path: root/src/ng/directive/ngTransclude.js
blob: 8eefb6fff5281d7ac1a72424bcb97d8589762eba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76