aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorTimmy Willison <timmywillisn@gmail.com>2012-07-27 18:19:01 -0400
committerTimmy Willison <timmywillisn@gmail.com>2012-07-27 18:19:18 -0400
commite07b444dfe87f26f0d6031920026142425505ad6 (patch)
treeab6f77aea11aef07f78dde727ff25eea9b8d7c9e /test
parent4039d3668decade6c7098f7f270c45dd54ff6a8c (diff)
downloadjquery-e07b444dfe87f26f0d6031920026142425505ad6.tar.gz
jquery-e07b444dfe87f26f0d6031920026142425505ad6.zip
Fix a regression where has with multiple contexts was not filtering correctly. Test added.
Diffstat (limited to 'test')
-rw-r--r--test/unit/traversing.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/test/unit/traversing.js b/test/unit/traversing.js
index 7f9678307..e7d519662 100644
--- a/test/unit/traversing.js
+++ b/test/unit/traversing.js
@@ -376,7 +376,7 @@ test("has(Element)", function() {
});
test("has(Selector)", function() {
- expect(4);
+ expect( 5 );
var obj = jQuery("#qunit-fixture").has("#sndp");
deepEqual( obj.get(), q("qunit-fixture"), "Keeps elements that have any element matching the selector as a descendant" );
@@ -385,7 +385,10 @@ test("has(Selector)", function() {
deepEqual( detached.has("i").get(), detached.get(), "...Even when detached" );
var multipleParent = jQuery("#qunit-fixture, #header").has("#sndp");
- deepEqual( obj.get(), q("qunit-fixture"), "Does not include elements that do not have the element as a descendant" );
+ deepEqual( multipleParent.get(), q("qunit-fixture"), "Does not include elements that do not have the element as a descendant" );
+
+ multipleParent = jQuery("#select1, #select2, #select3").has("#option1a, #option3a");
+ deepEqual( multipleParent.get(), q("select1", "select3"), "Multiple contexts are checks correctly" );
var multipleHas = jQuery("#qunit-fixture").has("#sndp, #first");
deepEqual( multipleHas.get(), q("qunit-fixture"), "Only adds elements once" );