X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=test%2Funit%2Fmanipulation.js;h=ff3dff164ef6131153d37edd0f5c2f805170ffd5;hb=4f9e78616ecd9ca403a25ee0e3dc71781484e553;hp=34425ed3a4c9c54ca795b823f022c3fa6560b3f5;hpb=292acd97a226ec15af2adc069d02973d59c6bc59;p=jquery.git diff --git a/test/unit/manipulation.js b/test/unit/manipulation.js index 34425ed..ff3dff1 100644 --- a/test/unit/manipulation.js +++ b/test/unit/manipulation.js @@ -739,7 +739,7 @@ test("insertAfter(String|Element|Array<Element>|jQuery)", function() { }); var testReplaceWith = function(val) { - expect(20); + expect(21); jQuery('#yahoo').replaceWith(val( 'buga' )); ok( jQuery("#replace")[0], 'Replace element with string' ); ok( !jQuery("#yahoo")[0], 'Verify that original element is gone, after string' ); @@ -800,6 +800,9 @@ var testReplaceWith = function(val) { equals( set[0].nodeName.toLowerCase(), "span", "Replace the disconnected node." ); equals( set.length, 1, "Replace the disconnected node." ); + var non_existant = jQuery('#does-not-exist').replaceWith( val("should not throw an error") ); + equals( non_existant.length, 0, "Length of non existant element." ); + var $div = jQuery("
").appendTo("body"); // TODO: Work on jQuery(...) inline script execution //$div.replaceWith("