X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=src%2Fjquery%2FcoreTest.js;h=a9c3e26d1d5b32002a2a91d0811e50cfa4c759f1;hb=c96b991493b3e432fe095a18cab29b046577976c;hp=5dd9d805805043c06e707ebaeb6673ba19bc1bb0;hpb=c8b7881c738f6949095029d75d847acc98b0afbc;p=jquery.git diff --git a/src/jquery/coreTest.js b/src/jquery/coreTest.js index 5dd9d80..a9c3e26 100644 --- a/src/jquery/coreTest.js +++ b/src/jquery/coreTest.js @@ -11,6 +11,11 @@ test("Basic requirements", function() { ok( $, "$()" ); }); +test("$()", function() { + var main = $("#main"); + isSet( $("div p", main).get(), q("sndp", "en", "sap"), "Basic selector with jQuery object as context" ); +}); + test("length", function() { ok( $("div").length == 2, "Get Number of Elements Found" ); }); @@ -29,7 +34,7 @@ test("get(Number)", function() { test("add(String|Element|Array)", function() { isSet( $("#sndp").add("#en").add("#sap").get(), q("sndp", "en", "sap"), "Check elements from document" ); - + isSet( $("#sndp").add( $("#en")[0] ).add( $("#sap") ).get(), q("sndp", "en", "sap"), "Check elements from document" ); ok( $([]).add($("#form")[0].elements).length > 13, "Check elements from array" ); var x = $([]).add($("

xxx

")).add($("

xxx

")); @@ -489,10 +494,11 @@ test("filter()", function() { isSet( $("p").filter(function() { return !$("a", this).length }).get(), q("sndp", "first"), "filter(Function)" ); }); -test("not(String)", function() { - expect(2); +test("not()", function() { + expect(3); ok( $("#main > p#ap > a").not("#google").length == 2, "not('selector')" ); isSet( $("p").not("#ap, #sndp, .result").get(), q("firstp", "en", "sap", "first"), "not('selector, selector')" ); + isSet( $("p").not($("#ap, #sndp, .result")).get(), q("firstp", "en", "sap", "first"), "not(jQuery)" ); });