X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=test%2Funit%2Ftraversing.js;h=f9e79372a761cc2196a04023a9399680b211925e;hb=1dee0d2ed8ae669d8276dbca06e27b70acb9a030;hp=3fd98f674f16bbaf489d441e98fd7f2265cdb33c;hpb=7be11207b9267592a639eb739dc8d719c7de56a1;p=jquery.git diff --git a/test/unit/traversing.js b/test/unit/traversing.js index 3fd98f6..f9e7937 100644 --- a/test/unit/traversing.js +++ b/test/unit/traversing.js @@ -1,12 +1,14 @@ module("traversing"); test("find(String)", function() { - expect(2); + expect(3); equals( 'Yahoo', jQuery('#foo').find('.blogTest').text(), 'Check for find' ); // using contents will get comments regular, text, and comment nodes var j = jQuery("#nonnodes").contents(); equals( j.find("div").length, 0, "Check node,textnode,comment to find zero divs" ); + + same( jQuery("#main").find("> div").get(), q("foo", "moretests", "tabindex-tests", "liveHandlerOrder", "siblingTest"), "find child elements" ); }); test("is(String)", function() { @@ -120,7 +122,7 @@ test("filter(jQuery)", function() { }) test("closest()", function() { - expect(10); + expect(11); same( jQuery("body").closest("body").get(), q("body"), "closest(body)" ); same( jQuery("body").closest("html").get(), q("html"), "closest(html)" ); same( jQuery("body").closest("div").get(), [], "closest(div)" ); @@ -137,7 +139,9 @@ test("closest()", function() { //Test that .closest() returns unique'd set equals( jQuery('#main p').closest('#main').length, 1, "Closest should return a unique set" ); - + + // Test on disconnected node + equals( jQuery("