Fixed one of the selector tests that was reporting incorrectly in browsers that actua...
[jquery.git] / test / unit / selector.js
index 646a36f..42624f2 100644 (file)
@@ -1,7 +1,7 @@
 module("selector");
 
 test("element", function() {
-       expect(17);
+       expect(18);
        reset();
 
        ok( jQuery("*").size() >= 30, "Select all" );
@@ -25,7 +25,7 @@ test("element", function() {
        ok( jQuery("#lengthtest input").length, '<input name="length"> cannot be found under IE, see #945' );
 
        // Check for unique-ness and sort order
-       //isSet( jQuery("*"), jQuery("*, *"), "Check for duplicates: *, *" );
+       isSet( jQuery("*"), jQuery("*, *"), "Check for duplicates: *, *" );
        isSet( jQuery("p"), jQuery("p, div p"), "Check for duplicates: p, div p" );
 
        t( "Checking sort order", "h2, h1", ["header", "banner", "userAgent"] );
@@ -316,7 +316,7 @@ test("pseudo (:) selectors", function() {
        t( "Last Child", "p:last-child", ["sap"] );
        t( "Only Child", "a:only-child", ["simon1","anchor1","yahoo","anchor2","liveLink1","liveLink2"] );
        t( "Empty", "ul:empty", ["firstUL"] );
-       t( "Enabled UI Element", "#form input:not([type=hidden]):enabled", ["text1","radio1","radio2","check1","check2","hidden2","name"] );
+       t( "Enabled UI Element", "#form input:not([type=hidden]):enabled", ["text1","radio1","radio2","check1","check2","hidden2","name","search"] );
        t( "Disabled UI Element", "#form input:disabled", ["text2"] );
        t( "Checked UI Element", "#form input:checked", ["radio2","check1"] );
        t( "Selected Option Element", "#form option:selected", ["option1a","option2d","option3b","option3c"] );
@@ -326,7 +326,7 @@ test("pseudo (:) selectors", function() {
        t( "Text Contains", "a:contains('Google Groups (Link)')", ["groups"] );
        t( "Text Contains", "a:contains('(Link)')", ["groups"] );
 
-       t( "Element Preceded By", "p ~ div", ["foo","fx-queue","fx-tests", "moretests","tabindex-tests", "liveHandlerOrder"] );
+       t( "Element Preceded By", "p ~ div", ["foo", "moretests","tabindex-tests", "liveHandlerOrder"] );
        t( "Not", "a.blog:not(.link)", ["mark"] );
        t( "Not - multiple", "#form option:not(:contains('Nothing'),#option1b,:selected)", ["option1c", "option1d", "option2b", "option2c", "option3d", "option3e"] );
        //t( "Not - complex", "#form option:not([id^='opt']:nth-child(-n+3))", [ "option1a", "option1d", "option2d", "option3d", "option3e"] );
@@ -358,8 +358,8 @@ test("pseudo (:) selectors", function() {
        t( "Position Less Than", "p:lt(3)", ["firstp","ap","sndp"] );
        t( "Is A Parent", "p:parent", ["firstp","ap","sndp","en","sap","first"] );
        t( "Is Visible", "#form input:visible", [] );
-       t( "Is Visible", "div:visible:not(.testrunner-toolbar)", ["nothiddendiv", "nothiddendivchild"] );
-       t( "Is Hidden", "#form input:hidden", ["text1","text2","radio1","radio2","check1","check2","hidden1","hidden2","name"] );
+       t( "Is Visible", "div:visible:not(.testrunner-toolbar):lt(2)", ["nothiddendiv", "nothiddendivchild"] );
+       t( "Is Hidden", "#form input:hidden", ["text1","text2","radio1","radio2","check1","check2","hidden1","hidden2","name","search"] );
        t( "Is Hidden", "#main:hidden", ["main"] );
        t( "Is Hidden", "#dl:hidden", ["dl"] );
 
@@ -374,18 +374,18 @@ test("pseudo (:) selectors", function() {
        t( "Check position filtering", "div.nothiddendiv:not(:lt(0))", ["nothiddendiv"] );
 
        t( "Check element position", "div div:eq(0)", ["nothiddendivchild"] );
-       t( "Check element position", "div div:eq(5)", ["fadeout"] );
-       t( "Check element position", "div div:eq(27)", ["t2037"] );
+       t( "Check element position", "div div:eq(5)", ["t2037"] );
+       t( "Check element position", "div div:eq(27)", ["hide"] );
        t( "Check element position", "div div:first", ["nothiddendivchild"] );
        t( "Check element position", "div > div:first", ["nothiddendivchild"] );
        t( "Check element position", "#dl div:first div:first", ["foo"] );
        t( "Check element position", "#dl div:first > div:first", ["foo"] );
        t( "Check element position", "div#nothiddendiv:first > div:first", ["nothiddendivchild"] );
        
-       t( "Form element :input", "#form :input", ["text1", "text2", "radio1", "radio2", "check1", "check2", "hidden1", "hidden2", "name", "button", "area1", "select1", "select2", "select3"] );
+       t( "Form element :input", "#form :input", ["text1", "text2", "radio1", "radio2", "check1", "check2", "hidden1", "hidden2", "name", "search", "button", "area1", "select1", "select2", "select3"] );
        t( "Form element :radio", "#form :radio", ["radio1", "radio2"] );
        t( "Form element :checkbox", "#form :checkbox", ["check1", "check2"] );
-       t( "Form element :text", "#form :text", ["text1", "text2", "hidden2", "name"] );
+       t( "Form element :text", "#form :text:not(#search)", ["text1", "text2", "hidden2", "name"] );
        t( "Form element :radio:checked", "#form :radio:checked", ["radio2"] );
        t( "Form element :checkbox:checked", "#form :checkbox:checked", ["check1"] );
        t( "Form element :radio:checked, :checkbox:checked", "#form :radio:checked, #form :checkbox:checked", ["radio2", "check1"] );