X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=test%2Funit%2Fcore.js;h=002692914691232e22b2928c844240d2294a1ce8;hb=5d49335eace4311de890b871e057d8b6e9122eb6;hp=85b421d5a628671ff0bd8ae52e6f1edd976345ca;hpb=8e53f7b5d6716e60d8c8ea7e167f2b187aae9d89;p=jquery.git diff --git a/test/unit/core.js b/test/unit/core.js index 85b421d..0026929 100644 --- a/test/unit/core.js +++ b/test/unit/core.js @@ -501,6 +501,15 @@ test("add(String|Element|Array|undefined)", function() { // use jQuery([]).add(form.elements) instead. //equals( jQuery([]).add(jQuery("#form")[0].elements).length, jQuery(jQuery("#form")[0].elements).length, "Array in constructor must equals array in add()" ); + var divs = jQuery("
").add("#sndp"); + ok( !divs[0].parentNode, "Make sure the first element is still the disconnected node." ); + + divs = jQuery("
test
").add("#sndp"); + equals( divs[0].parentNode.nodeType, 11, "Make sure the first element is still the disconnected node." ); + + divs = jQuery("#sndp").add("
"); + ok( !divs[1].parentNode, "Make sure the first element is still the disconnected node." ); + var tmp = jQuery("
"); var x = jQuery([]).add(jQuery("

xxx

").appendTo(tmp)).add(jQuery("

xxx

").appendTo(tmp)); @@ -522,10 +531,6 @@ test("add(String|Element|Array|undefined)", function() { var notDefined; equals( jQuery([]).add(notDefined).length, 0, "Check that undefined adds nothing" ); - // Added after #2811 - equals( jQuery([]).add([window,document,document.body,document]).length, 3, "Pass an array" ); - equals( jQuery(document).add(document).length, 1, "Check duplicated elements" ); - equals( jQuery(window).add(window).length, 1, "Check duplicated elements using the window" ); ok( jQuery([]).add( document.getElementById('form') ).length >= 13, "Add a form (adds the elements)" ); });