X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fjquery%2FcoreTest.js;h=d673711aa8a209baace6a5567f690ee2b453d045;hb=85afa7c1ba32e2e867b89e4222a4d27ea97dd20d;hp=e9192849758e6562df3a477493f7ac00d8390b44;hpb=3ae74b523ec379a1753d116bb7f1aec8db2c52d4;p=jquery.git diff --git a/src/jquery/coreTest.js b/src/jquery/coreTest.js index e919284..d673711 100644 --- a/src/jquery/coreTest.js +++ b/src/jquery/coreTest.js @@ -976,3 +976,30 @@ test("slice()", function() { isSet( $("#ap a").slice(0,3), q("google", "groups", "anchor1"), "slice(0,3)" ); isSet( $("#ap a").slice(-1), q("mark"), "slice(-1)" ); }); + +test("map()", function() { + expect(2); + + isSet( + $("#ap").map(function(){ + return $(this).find("a").get(); + }), + q("google", "groups", "anchor1", "mark"), + "Array Map" + ); + + isSet( + $("#ap > a").map(function(){ + return this.parentNode; + }), + q("ap","ap","ap"), + "Single Map" + ); +}); + +test("contents()", function() { + expect(3); + equals( $("#ap").contents().length, 9, "Check element contents" ); + ok( $("#iframe").contents()[0], "Check existance of IFrame document" ); + ok( $("#iframe").contents()[0].body, "Check existance of IFrame body" ); +});