diff options
author | Timo Tijhof <krinklemail@gmail.com> | 2012-12-11 01:07:07 +0100 |
---|---|---|
committer | Dave Methvin <dave.methvin@gmail.com> | 2012-12-10 21:48:20 -0500 |
commit | 55313d32a22246fa1e09c3d66713632359848806 (patch) | |
tree | a1780b886ee178c357ba77908278199621929b89 /test/unit/traversing.js | |
parent | d41b983259042d3a07ae785c09f71c68d9ce7c3f (diff) | |
download | jquery-55313d32a22246fa1e09c3d66713632359848806.tar.gz jquery-55313d32a22246fa1e09c3d66713632359848806.zip |
Test: Update index.html to new QUnit format. Close gh-1061.
Depends on jquery/sizzle#177, included with the Sizzle submodule in this commit.
Diffstat (limited to 'test/unit/traversing.js')
-rw-r--r-- | test/unit/traversing.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/test/unit/traversing.js b/test/unit/traversing.js index 6e50e1cc4..9388089b2 100644 --- a/test/unit/traversing.js +++ b/test/unit/traversing.js @@ -9,7 +9,7 @@ test( "find(String)", function() { equal( j.find("div").length, 0, "Check node,textnode,comment to find zero divs" ); equal( j.find("div").andSelf().length, 3, "Check node,textnode,comment to find zero divs, but preserves pushStack" ); - deepEqual( jQuery("#qunit-fixture").find("> div").get(), q( "foo", "moretests", "tabindex-tests", "liveHandlerOrder", "siblingTest", "fx-test-group" ), "find child elements" ); + deepEqual( jQuery("#qunit-fixture").find("> div").get(), q( "foo", "nothiddendiv", "moretests", "tabindex-tests", "liveHandlerOrder", "siblingTest", "fx-test-group" ), "find child elements" ); deepEqual( jQuery("#qunit-fixture").find("> #foo, > #moretests").get(), q( "foo", "moretests" ), "find child elements" ); deepEqual( jQuery("#qunit-fixture").find("> #foo > p").get(), q( "sndp", "en", "sap" ), "find child elements" ); @@ -286,8 +286,8 @@ test("closest()", function() { deepEqual( jQuery("body").closest("div").get(), [], "closest(div)" ); deepEqual( jQuery("#qunit-fixture").closest("span,#html").get(), q("html"), "closest(span,#html)" ); - deepEqual( jQuery("div:eq(1)").closest("div:first").get(), [], "closest(div:first)" ); - deepEqual( jQuery("div").closest("body:first div:last").get(), q("fx-tests"), "closest(body:first div:last)" ); + deepEqual( jQuery("#qunit-fixture").closest("div:first").get(), [], "closest(div:first)" ); + deepEqual( jQuery("#qunit-fixture div").closest("body:first div:last").get(), q("fx-tests"), "closest(body:first div:last)" ); // Test .closest() limited by the context var jq = jQuery("#nothiddendivchild"); @@ -312,15 +312,15 @@ test("closest(jQuery)", function() { expect(8); var $child = jQuery("#nothiddendivchild"), $parent = jQuery("#nothiddendiv"), - $main = jQuery("#qunit-fixture"), + $sibling = jQuery("#foo"), $body = jQuery("body"); ok( $child.closest( $parent ).is("#nothiddendiv"), "closest( jQuery('#nothiddendiv') )" ); ok( $child.closest( $parent[0] ).is("#nothiddendiv"), "closest( jQuery('#nothiddendiv') ) :: node" ); ok( $child.closest( $child ).is("#nothiddendivchild"), "child is included" ); ok( $child.closest( $child[0] ).is("#nothiddendivchild"), "child is included :: node" ); equal( $child.closest( document.createElement("div") ).length, 0, "created element is not related" ); - equal( $child.closest( $main ).length, 0, "Main not a parent of child" ); - equal( $child.closest( $main[0] ).length, 0, "Main not a parent of child :: node" ); + equal( $child.closest( $sibling ).length, 0, "Sibling not a parent of child" ); + equal( $child.closest( $sibling[0] ).length, 0, "Sibling not a parent of child :: node" ); ok( $child.closest( $body.add($parent) ).is("#nothiddendiv"), "Closest ancestor retrieved." ); }); |