From 0765822b31a64e15bc88bd5f98e01b8c67b93822 Mon Sep 17 00:00:00 2001 From: Richard Gibson Date: Fri, 17 Jan 2014 00:38:56 -0500 Subject: [PATCH] Traversing: Check all pairwise element combinations for .find( els ) (cherry picked from commit 391c21b15d769fac1c37631b28c0226f57a59796) Ref b8d0d54a3c4960794a1b492957abeb56eddd1e48 Fixes #14701 --- test/unit/traversing.js | 6 ++++-- 1 file 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)" ); -- 2.39.5