diff options
author | Dave Methvin <dave.methvin@gmail.com> | 2011-10-11 20:30:07 -0400 |
---|---|---|
committer | Dave Methvin <dave.methvin@gmail.com> | 2011-10-11 20:31:45 -0400 |
commit | 6afc2c074bec5c19063c8f8ebca6bfb53c7d4cef (patch) | |
tree | 50fadfbe4899b96de57a8973b5385c2f48cf0e44 /test/unit/event.js | |
parent | d29182e8d00b08def0f37fe7e77d9836e39b83a8 (diff) | |
download | jquery-6afc2c074bec5c19063c8f8ebca6bfb53c7d4cef.tar.gz jquery-6afc2c074bec5c19063c8f8ebca6bfb53c7d4cef.zip |
Fixes #10477. Get `.off(type, null, fn)` right.
Diffstat (limited to 'test/unit/event.js')
-rw-r--r-- | test/unit/event.js | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/test/unit/event.js b/test/unit/event.js index 9bf9f788c..83f83469a 100644 --- a/test/unit/event.js +++ b/test/unit/event.js @@ -704,7 +704,7 @@ test("bind()/trigger()/unbind() on plain object", function() { }); test("unbind(type)", function() { - expect( 0 ); + expect( 1 ); var $elem = jQuery("#firstp"), message; @@ -736,6 +736,17 @@ test("unbind(type)", function() { $elem.bind("error1 error2.test",error) .unbind() .trigger("error1").triggerHandler("error2"); + + // Should only unbind the specified function + jQuery( document ).bind( "click", function(){ + ok( true, "called handler after selective removal"); + }); + var func = function(){ }; + jQuery( document ) + .bind( "click", func ) + .unbind( "click", func ) + .click() + .unbind( "click" ); }); test("unbind(eventObject)", function() { @@ -1111,7 +1122,7 @@ test("jQuery.Event( type, props )", function() { // Supports jQuery.Event implementation equal( event.type, "keydown", "Verify type" ); - + // ensure "type" in props won't clobber the one set by constructor equal( jQuery.inArray("type", jQuery.event.props), -1, "'type' property not in props (#10375)" ); |