X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=test%2Funit%2Fcore.js;h=4d04af759a1509a61e1c499a50bb333e2758d11d;hb=1eae1541b8b4ca054d63d48f07001f55fa52fa5d;hp=ef36c4f784798aebe65ac85fb863c1626678e023;hpb=d62875fb0181c44f8b34a8e842ae323801637b25;p=jquery.git diff --git a/test/unit/core.js b/test/unit/core.js index ef36c4f..4d04af7 100644 --- a/test/unit/core.js +++ b/test/unit/core.js @@ -899,7 +899,7 @@ test("append(String|Element|Array<Element>|jQuery)", function() { }); test("appendTo(String|Element|Array<Element>|jQuery)", function() { - expect(6); + expect(7); var defaultText = 'Try them out:' jQuery('buga').appendTo('#first'); equals( jQuery("#first").text(), defaultText + 'buga', 'Check if text appending works' ); @@ -916,6 +916,9 @@ test("appendTo(String|Element|Array<Element>|jQuery)", function() { equals( expected, jQuery('#sap').text(), "Check for appending of array of elements" ); reset(); + ok( jQuery(document.createElement("script")).appendTo("body").length, "Make sure a disconnected script can be appended." ); + + reset(); expected = document.querySelectorAll ? "This link has class=\"blog\": Simon Willison's WeblogYahooTry them out:" : "This link has class=\"blog\": Simon Willison's WeblogTry them out:Yahoo"; @@ -1349,7 +1352,7 @@ test("val(String/Number)", function() { }); test("html(String)", function() { - expect(13); + expect(17); jQuery.scriptorder = 0; @@ -1378,6 +1381,10 @@ test("html(String)", function() { equals( $div.html( 5 ).html(), '5', 'Setting a number as html' ); equals( $div.html( 0 ).html(), '0', 'Setting a zero as html' ); + reset(); + + jQuery("#main").html('
'); + stop(); jQuery("#main").html(''); @@ -1404,11 +1411,14 @@ test("filter()", function() { }); test("closest()", function() { - expect(4); + expect(6); isSet( jQuery("body").closest("body").get(), q("body"), "closest(body)" ); isSet( jQuery("body").closest("html").get(), q("html"), "closest(html)" ); isSet( jQuery("body").closest("div").get(), [], "closest(div)" ); isSet( jQuery("#main").closest("span,#html").get(), q("html"), "closest(span,#html)" ); + + isSet( jQuery("div:eq(1)").closest("div:first").get(), [], "closest(div:first)" ); + isSet( jQuery("div").closest("body:first div:last").get(), q("divWithNoTabIndex"), "closest(body:first div:last)" ); }); test("not()", function() {