ok( $, "$()" );\r
});\r
\r
+test("$()", function() {\r
+ var main = $("#main");\r
+ isSet( $("div p", main).get(), q("sndp", "en", "sap"), "Basic selector with jQuery object as context" );\r
+});\r
+\r
test("length", function() {\r
ok( $("div").length == 2, "Get Number of Elements Found" );\r
});\r
\r
test("add(String|Element|Array)", function() {\r
isSet( $("#sndp").add("#en").add("#sap").get(), q("sndp", "en", "sap"), "Check elements from document" );\r
- \r
+ isSet( $("#sndp").add( $("#en")[0] ).add( $("#sap") ).get(), q("sndp", "en", "sap"), "Check elements from document" );\r
ok( $([]).add($("#form")[0].elements).length > 13, "Check elements from array" );\r
\r
var x = $([]).add($("<p id='x1'>xxx</p>")).add($("<p id='x2'>xxx</p>"));\r
});\r
\r
test("attr(String, Function)", function() {\r
- expect(1);\r
+ expect(2);\r
ok( $('#text1').attr('value', function() { return this.id })[0].value == "text1", "Set value from id" );\r
+ ok( $('#text1').attr('title', function(i) { return i }).attr('title') == "0", "Set value with an index");\r
});\r
\r
test("attr(Hash)", function() {\r
isSet( $("p").filter(function() { return !$("a", this).length }).get(), q("sndp", "first"), "filter(Function)" );\r
});\r
\r
-test("not(String)", function() {\r
- expect(2);\r
+test("not()", function() {\r
+ expect(3);\r
ok( $("#main > p#ap > a").not("#google").length == 2, "not('selector')" );\r
isSet( $("p").not("#ap, #sndp, .result").get(), q("firstp", "en", "sap", "first"), "not('selector, selector')" );\r
+ isSet( $("p").not($("#ap, #sndp, .result")).get(), q("firstp", "en", "sap", "first"), "not(jQuery)" );\r
});\r
\r
\r