X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fjquery%2FcoreTest.js;h=a7b470e09b354ff7aba14a5ec94fcda82f8e6fb9;hb=d9464547e0c328bf9f9b67e8d38621023a7e450e;hp=28ba00702907155cb97f00aa21bd01542e401ce7;hpb=3362ccf3ddc20d787551ffdb441ae606a3d06630;p=jquery.git diff --git a/src/jquery/coreTest.js b/src/jquery/coreTest.js index 28ba007..a7b470e 100644 --- a/src/jquery/coreTest.js +++ b/src/jquery/coreTest.js @@ -494,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)" ); }); @@ -662,3 +663,13 @@ test("eq(), gt(), lt(), contains()", function() { isSet( $("#ap a").lt(3).get(), q("google", "groups", "anchor1"), "lt()" ); isSet( $("#foo a").contains("log").get(), q("anchor2", "simon"), "contains()" ); }); + +test("click() context", function() { + $('
  • Change location
  • ').prependTo('#firstUL').find('a').bind('click', function() { + var close = $('spanx', this); // same with $(this).find('span'); + ok( close.length == 0, "Element does not exist, length must be zero" ); + ok( !close[0], "Element does not exist, direct access to element must return undefined" ); + //console.log( close[0]); // it's the and not a element + return false; + }).click(); +}); \ No newline at end of file