X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=test%2Funit%2Fmanipulation.js;h=ff3dff164ef6131153d37edd0f5c2f805170ffd5;hb=7705c35b140f378e407c196599cc738bc54c5cec;hp=f0e2eaec2643820d9e5b68f853672e76164e2ec8;hpb=0a0cff9d29c4bd559da689d96c532d06c03fce09;p=jquery.git diff --git a/test/unit/manipulation.js b/test/unit/manipulation.js index f0e2eae..ff3dff1 100644 --- a/test/unit/manipulation.js +++ b/test/unit/manipulation.js @@ -402,7 +402,8 @@ test("append(Function) with incoming value", function() { }); test("append the same fragment with events (Bug #6997, 5566)", function () { - expect(2 + (document.fireEvent ? 1 : 0)); + var doExtra = !jQuery.support.noCloneEvent && document.fireEvent; + expect(2 + (doExtra ? 1 : 0)); stop(1000); var element; @@ -410,7 +411,7 @@ test("append the same fragment with events (Bug #6997, 5566)", function () { // This patch modified the way that cloning occurs in IE; we need to make sure that // native event handlers on the original object don't get disturbed when they are // modified on the clone - if (!jQuery.support.noCloneEvent && document.fireEvent) { + if ( doExtra ) { element = jQuery("div:first").click(function () { ok(true, "Event exists on original after being unbound on clone"); jQuery(this).unbind('click'); @@ -738,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' ); @@ -799,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("