diff options
author | jaubourg <j@ubourg.net> | 2011-04-12 00:27:51 +0200 |
---|---|---|
committer | jaubourg <j@ubourg.net> | 2011-04-12 00:27:51 +0200 |
commit | f6f1cc77f402f0825898756e8c2100798918a61a (patch) | |
tree | d77849f07ca281de430d1740d395f1b91951559c /test | |
parent | 4c3aba9a15c936696ad2e799f7e372bf2aeb38a5 (diff) | |
parent | e9905b15d4ab90471d12508938e8935f4cc63581 (diff) | |
download | jquery-f6f1cc77f402f0825898756e8c2100798918a61a.tar.gz jquery-f6f1cc77f402f0825898756e8c2100798918a61a.zip |
Merge branch 'master' of github.com:jquery/jquery
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/event.js | 21 | ||||
-rw-r--r-- | test/unit/traversing.js | 12 |
2 files changed, 24 insertions, 9 deletions
diff --git a/test/unit/event.js b/test/unit/event.js index cefdf5833..b1fd919f5 100644 --- a/test/unit/event.js +++ b/test/unit/event.js @@ -2022,6 +2022,27 @@ test("delegate with submit", function() { jQuery(document).undelegate(); }); +test("undelegate() with only namespaces", function(){ + expect(2); + + var $delegate = jQuery("#liveHandlerOrder"), + count = 0; + + $delegate.delegate("a", "click.ns", function(e) { + count++; + }); + + jQuery("a", $delegate).eq(0).trigger("click.ns"); + + equals( count, 1, "delegated click.ns"); + + $delegate.undelegate(".ns"); + + jQuery("a", $delegate).eq(1).trigger("click.ns"); + + equals( count, 1, "no more .ns after undelegate"); +}); + test("Non DOM element events", function() { expect(1); diff --git a/test/unit/traversing.js b/test/unit/traversing.js index 6228a0b98..140b337aa 100644 --- a/test/unit/traversing.js +++ b/test/unit/traversing.js @@ -72,7 +72,7 @@ test("is(String|undefined)", function() { }); test("is(jQuery)", function() { - expect(24); + expect(23); ok( jQuery('#form').is( jQuery('form') ), 'Check for element: A form is a form' ); ok( !jQuery('#form').is( jQuery('div') ), 'Check for element: A form is not a div' ); ok( jQuery('#mark').is( jQuery('.blog') ), 'Check for class: Expected class "blog"' ); @@ -83,7 +83,6 @@ test("is(jQuery)", function() { ok( !jQuery('#en').is( jQuery('[lang="de"]') ), 'Check for attribute: Expected attribute lang to be "en", not "de"' ); ok( jQuery('#text1').is( jQuery('[type="text"]') ), 'Check for attribute: Expected attribute type to be "text"' ); ok( !jQuery('#text1').is( jQuery('[type="radio"]') ), 'Check for attribute: Expected attribute type to be "text", not "radio"' ); - ok( jQuery('#text2').is( jQuery(':disabled') ), 'Check for pseudoclass: Expected to be disabled' ); ok( !jQuery('#text1').is( jQuery(':disabled') ), 'Check for pseudoclass: Expected not disabled' ); ok( jQuery('#radio2').is( jQuery(':checked') ), 'Check for pseudoclass: Expected to be checked' ); ok( !jQuery('#radio1').is( jQuery(':checked') ), 'Check for pseudoclass: Expected not checked' ); @@ -223,10 +222,6 @@ test("closest(Array)", function() { same( jQuery("body").closest(["span","html"]), [{selector:"html", elem:document.documentElement, level:2}], "closest([body, html])" ); }); -<<<<<<< HEAD -test("not(Selector|undefined)", function() { - expect(11); -======= test("closest(jQuery)", function() { expect(8); var $child = jQuery("#nothiddendivchild"), @@ -243,9 +238,8 @@ test("closest(jQuery)", function() { ok( $child.closest( $body.add($parent) ).is('#nothiddendiv'), "Closest ancestor retrieved." ); }); -test("not(Selector)", function() { - expect(7); ->>>>>>> 1a167767305202797cf4c839eb64bd7adfb00182 +test("not(Selector|undefined)", function() { + expect(11); equals( jQuery("#main > p#ap > a").not("#google").length, 2, "not('selector')" ); same( jQuery("p").not(".result").get(), q("firstp", "ap", "sndp", "en", "sap", "first"), "not('.class')" ); same( jQuery("p").not("#ap, #sndp, .result").get(), q("firstp", "en", "sap", "first"), "not('selector, selector')" ); |