File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -1091,15 +1091,21 @@ describe('jqLite', function() {
1091
1091
} ) ;
1092
1092
1093
1093
it ( 'should have event.isDefaultPrevented method' , function ( ) {
1094
- jqLite ( a ) . on ( 'click' , function ( e ) {
1094
+ var element = jqLite ( a ) ,
1095
+ clickSpy = jasmine . createSpy ( 'clickSpy' ) ;
1096
+
1097
+ clickSpy . andCallFake ( function ( e ) {
1095
1098
expect ( function ( ) {
1096
1099
expect ( e . isDefaultPrevented ( ) ) . toBe ( false ) ;
1097
1100
e . preventDefault ( ) ;
1098
1101
expect ( e . isDefaultPrevented ( ) ) . toBe ( true ) ;
1099
1102
} ) . not . toThrow ( ) ;
1100
1103
} ) ;
1101
1104
1105
+ element . on ( 'click' , clickSpy ) ;
1106
+
1102
1107
browserTrigger ( a , 'click' ) ;
1108
+ expect ( clickSpy ) . toHaveBeenCalled ( ) ;
1103
1109
} ) ;
1104
1110
1105
1111
it ( 'should stop triggering handlers when stopImmediatePropagation is called' , function ( ) {
You can’t perform that action at this time.
0 commit comments