X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=src%2Fjquery%2FcoreTest.js;h=0f1e0f5a8ac0c735311650f95b66decc4c639f02;hb=53e12752e00c2a86757ec15a0c871dee8ccd1bea;hp=f736d4d7080e3149ae7cf3e9739415142f596b08;hpb=729396e6cfb1a0495399609f5929fb630a49649d;p=jquery.git diff --git a/src/jquery/coreTest.js b/src/jquery/coreTest.js index f736d4d..0f1e0f5 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" ); }); @@ -82,8 +87,9 @@ test("attr(String)", function() { }); test("attr(String, Function)", function() { - expect(1); + expect(2); ok( $('#text1').attr('value', function() { return this.id })[0].value == "text1", "Set value from id" ); + ok( $('#text1').attr('title', function(i) { return i }).attr('title') == "0", "Set value with an index"); }); test("attr(Hash)", function() {