X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fjquery%2FcoreTest.js;h=f736d4d7080e3149ae7cf3e9739415142f596b08;hb=729396e6cfb1a0495399609f5929fb630a49649d;hp=ccd84f72b770cb0ed8a98a261ccb5b5673433a4a;hpb=e50a2f6ca3a03501510228f940f48a0faa12127d;p=jquery.git diff --git a/src/jquery/coreTest.js b/src/jquery/coreTest.js index ccd84f7..f736d4d 100644 --- a/src/jquery/coreTest.js +++ b/src/jquery/coreTest.js @@ -192,7 +192,7 @@ test("wrap(String|Element)", function() { }); test("append(String|Element|Array<Element>|jQuery)", function() { - expect(5); + expect(9); var defaultText = 'Try them out:' var result = $('#first').append('buga'); ok( result.text() == defaultText + 'buga', 'Check if text appending works' ); @@ -212,6 +212,15 @@ test("append(String|Element|Array<Element>|jQuery)", function() { expected = "This link has class=\"blog\": Simon Willison's WeblogTry them out:Yahoo"; $('#sap').append($("#first, #yahoo")); ok( expected == $('#sap').text(), "Check for appending of jQuery object" ); + + reset(); + $("#sap").append( 5 ); + ok( $("#sap")[0].innerHTML.match( /5$/ ), "Check for appending a number" ); + + reset(); + ok( $("#sap").append([]), "Check for appending an empty array." ); + ok( $("#sap").append(""), "Check for appending an empty string." ); + ok( $("#sap").append(document.getElementsByTagName("foo")), "Check for appending an empty nodelist." ); }); test("appendTo(String|Element|Array<Element>|jQuery)", function() {