diff options
author | jeresig <jeresig@gmail.com> | 2010-10-22 00:36:07 -0400 |
---|---|---|
committer | jeresig <jeresig@gmail.com> | 2010-10-22 00:36:07 -0400 |
commit | 4fc86d5eb1d4eaa3efad77dc224271d254f491e4 (patch) | |
tree | b39854a501bcb7cf604ca8bbd55ae30c055f825b | |
parent | 8b129ccd49365582c4013fd391f6f83cc75a5d0a (diff) | |
download | jquery-4fc86d5eb1d4eaa3efad77dc224271d254f491e4.tar.gz jquery-4fc86d5eb1d4eaa3efad77dc224271d254f491e4.zip |
Make sure that we aren't reading one of the bad expandos. Fixes #7212.
-rw-r--r-- | test/unit/selector.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/test/unit/selector.js b/test/unit/selector.js index 04f99d628..abb071748 100644 --- a/test/unit/selector.js +++ b/test/unit/selector.js @@ -153,7 +153,7 @@ test("class", function() { }); test("name", function() { - expect(14); + expect(15); t( "Name selector", "input[name=action]", ["text1"] ); t( "Name selector with single quotes", "input[name='action']", ["text1"] ); @@ -168,6 +168,12 @@ test("name", function() { same( jQuery("#form").find("input[name=action]").get(), q("text1"), "Name selector within the context of another element" ); same( jQuery("#form").find("input[name='foo[bar]']").get(), q("hidden2"), "Name selector for grouped form element within the context of another element" ); + var form = jQuery("<form><input name='id'/></form>").appendTo("body"); + + equals( form.find("input").length, 1, "Make sure that rooted queries on forms (with possible expandos) work." ); + + form.remove(); + var a = jQuery('<div><a id="tName1ID" name="tName1">tName1 A</a><a id="tName2ID" name="tName2">tName2 A</a><div id="tName1">tName1 Div</div></div>').appendTo('#main').children(); equals( a.length, 3, "Make sure the right number of elements were inserted." ); |