X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=test%2Funit%2Fcore.js;h=4cca7d967714f8e8f7b93eaba97a8e0c09b36fc5;hb=789ad4f769a63fbb9eafd806ebf9e835d6fc771b;hp=9f46dd4d4d2227e699b3224dd0ed3b4f2f009b0f;hpb=f8698395acbe428bd7c3dd6dd5700a0c660deeab;p=jquery.git diff --git a/test/unit/core.js b/test/unit/core.js index 9f46dd4..4cca7d9 100644 --- a/test/unit/core.js +++ b/test/unit/core.js @@ -12,7 +12,7 @@ test("Basic requirements", function() { }); test("$()", function() { - expect(4); + expect(8); var main = $("#main"); isSet( $("div p", main).get(), q("sndp", "en", "sap"), "Basic selector with jQuery object as context" ); @@ -41,6 +41,15 @@ test("$()", function() { equals( img.length, 1, "Correct number of elements generated for img" ); var div = $("

"); equals( div.length, 4, "Correct number of elements generated for div hr code b" ); + + // can actually yield more than one, when iframes are included, the window is an array as well + equals( $(window).length, 1, "Correct number of elements generated for window" ); + + equals( $(document).length, 1, "Correct number of elements generated for document" ); + + equals( $([1,2,3]).get(1), 2, "Test passing an array to the factory" ); + + equals( $(document.body).get(0), $('body').get(0), "Test passing an html node to the factory" ); }); test("browser", function() {