File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -2725,6 +2725,30 @@ QUnit.test( "Inline event result is returned (#13993)", function( assert ) {
27252725 assert . equal ( result , 42 , "inline handler returned value" ) ;
27262726} ) ;
27272727
2728+ QUnit . test ( ".off() removes the expando when there's no more data" , function ( assert ) {
2729+ assert . expect ( 2 ) ;
2730+
2731+ var key ,
2732+ div = jQuery ( "<div/>" ) . appendTo ( "#qunit-fixture" ) ;
2733+
2734+ div . on ( "click" , false ) ;
2735+ div . on ( "custom" , function ( ) {
2736+ assert . ok ( true , "Custom event triggered" ) ;
2737+ } ) ;
2738+ div . trigger ( "custom" ) ;
2739+ div . off ( "click custom" ) ;
2740+
2741+ // Make sure the expando is gone
2742+ for ( key in div [ 0 ] ) {
2743+ if ( / ^ j Q u e r y / . test ( key ) ) {
2744+ assert . strictEqual (
2745+ div [ 0 ] [ key ] , undefined ,
2746+ "Expando was not removed when there was no more data"
2747+ ) ;
2748+ }
2749+ }
2750+ } ) ;
2751+
27282752QUnit . test ( "preventDefault() on focusin does not throw exception" , function ( assert ) {
27292753 assert . expect ( 1 ) ;
27302754
You can’t perform that action at this time.
0 commit comments