diff options
author | Richard Gibson <richard.gibson@gmail.com> | 2014-01-17 00:38:56 -0500 |
---|---|---|
committer | Richard Gibson <richard.gibson@gmail.com> | 2014-01-17 01:09:32 -0500 |
commit | 0765822b31a64e15bc88bd5f98e01b8c67b93822 (patch) | |
tree | f0ba22d990a5f00de6e791c92c9bb35f3b7cb257 | |
parent | e51a85bd736c764d82739056892465ec85e6aafb (diff) | |
download | jquery-0765822b31a64e15bc88bd5f98e01b8c67b93822.tar.gz jquery-0765822b31a64e15bc88bd5f98e01b8c67b93822.zip |
Traversing: Check all pairwise element combinations for .find( els )
(cherry picked from commit 391c21b15d769fac1c37631b28c0226f57a59796)
Ref b8d0d54a3c4960794a1b492957abeb56eddd1e48
Fixes #14701
-rw-r--r-- | test/unit/traversing.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/test/unit/traversing.js b/test/unit/traversing.js index 77479ff19..09275c0d6 100644 --- a/test/unit/traversing.js +++ b/test/unit/traversing.js @@ -24,19 +24,21 @@ test( "find(leading combinator)", function() { }); test( "find(node|jQuery object)", function() { - expect( 12 ); + expect( 13 ); var $foo = jQuery("#foo"), $blog = jQuery(".blogTest"), $first = jQuery("#first"), $two = $blog.add( $first ), + $twoMore = jQuery("#ap").add( $blog ), $fooTwo = $foo.add( $blog ); equal( $foo.find( $blog ).text(), "Yahoo", "Find with blog jQuery object" ); equal( $foo.find( $blog[ 0 ] ).text(), "Yahoo", "Find with blog node" ); equal( $foo.find( $first ).length, 0, "#first is not in #foo" ); equal( $foo.find( $first[ 0 ]).length, 0, "#first not in #foo (node)" ); - ok( $foo.find( $two ).is(".blogTest"), "Find returns only nodes within #foo" ); + deepEqual( $foo.find( $two ).get(), $blog.get(), "Find returns only nodes within #foo" ); + deepEqual( $foo.find( $twoMore ).get(), $blog.get(), "...regardless of order" ); ok( $fooTwo.find( $blog ).is(".blogTest"), "Blog is part of the collection, but also within foo" ); ok( $fooTwo.find( $blog[ 0 ] ).is(".blogTest"), "Blog is part of the collection, but also within foo(node)" ); |