Added a fix and test for bug #978 (Appending elements into an IFrame, in IE).
[jquery.git] / src / selector / selectorTest.js
index be216f8..fea247e 100644 (file)
@@ -11,7 +11,7 @@ test("expressions - element", function() {
 });\r
 \r
 test("expressions - id", function() {\r
-       expect(11);\r
+       expect(13);\r
        t( "ID Selector", "#body", ["body"] );\r
        t( "ID Selector w/ Element", "body#body", ["body"] );\r
        t( "ID Selector w/ Element", "ul#first", [] );\r
@@ -25,7 +25,11 @@ test("expressions - id", function() {
        t( "All Children of ID", "#foo/*", ["sndp", "en", "sap"] );\r
        t( "All Children of ID with no children", "#firstUL/*", [] );\r
        \r
-       t( "ID selector with non-existant ancestor", "#asdfasdf #foobar", [] );\r
+       $('<a name="tName1">tName1 A</a><a name="tName2">tName2 A</a><div id="tName1">tName1 Div</div>').appendTo('#main');\r
+       ok( $("#tName1")[0].id == 'tName1', "ID selector with same value for a name attribute" );\r
+       ok( $("#tName2").length == 0, "ID selector non-existing but name attribute on an A tag" );\r
+       \r
+       t( "ID selector with non-existant ancestor", "#asdfasdf #foobar", [] ); // bug #986\r
 });\r
 \r
 \r
@@ -140,8 +144,8 @@ test("expressions - basic xpath", function() {
        t( "Attribute Exists", "//a[@title]", ["google"] );\r
        t( "Attribute Equals", "//a[@rel='bookmark']", ["simon1"] );\r
        t( "Parent Axis", "//p/..", ["main","foo"] );\r
-       t( "Sibling Axis", "//p/../", ["firstp","ap","foo","first","firstUL","empty","form","floatTest","sndp","en","sap"] );\r
-       t( "Sibling Axis", "//p/../*", ["firstp","ap","foo","first","firstUL","empty","form","floatTest","sndp","en","sap"] );\r
+       t( "Sibling Axis", "//p/../", ["firstp","ap","foo","first","firstUL","empty","form","floatTest","iframe","sndp","en","sap"] );\r
+       t( "Sibling Axis", "//p/../*", ["firstp","ap","foo","first","firstUL","empty","form","floatTest","iframe","sndp","en","sap"] );\r
        t( "Has Children", "//p[a]", ["firstp","ap","en","sap"] );\r
        \r
        $("#foo").each(function() {\r