This commit is contained in:
Brandon Aaron 2007-02-07 15:06:49 +00:00
parent 980b5d72db
commit ecaa4d4570
2 changed files with 7 additions and 2 deletions

View file

@ -210,7 +210,7 @@ test("wrap(String|Element)", function() {
}); });
test("append(String|Element|Array<Element>|jQuery)", function() { test("append(String|Element|Array<Element>|jQuery)", function() {
expect(9); expect(10);
var defaultText = 'Try them out:' var defaultText = 'Try them out:'
var result = $('#first').append('<b>buga</b>'); var result = $('#first').append('<b>buga</b>');
ok( result.text() == defaultText + 'buga', 'Check if text appending works' ); ok( result.text() == defaultText + 'buga', 'Check if text appending works' );
@ -239,6 +239,11 @@ test("append(String|Element|Array&lt;Element&gt;|jQuery)", function() {
ok( $("#sap").append([]), "Check for appending an empty array." ); ok( $("#sap").append([]), "Check for appending an empty array." );
ok( $("#sap").append(""), "Check for appending an empty string." ); ok( $("#sap").append(""), "Check for appending an empty string." );
ok( $("#sap").append(document.getElementsByTagName("foo")), "Check for appending an empty nodelist." ); ok( $("#sap").append(document.getElementsByTagName("foo")), "Check for appending an empty nodelist." );
reset();
$("#sap").append(document.getElementById('form'));
ok( $("#sap>form").size() == 1, "Check for appending a form" );
}); });
test("appendTo(String|Element|Array&lt;Element&gt;|jQuery)", function() { test("appendTo(String|Element|Array&lt;Element&gt;|jQuery)", function() {

View file

@ -1470,7 +1470,7 @@ jQuery.extend({
if ( arg.length === 0 ) if ( arg.length === 0 )
return; return;
if ( arg[0] == undefined ) if ( arg[0] == undefined || jQuery.nodeName(arg,"form") )
r.push( arg ); r.push( arg );
else else
r = jQuery.merge( r, arg ); r = jQuery.merge( r, arg );