From: Michał Gołębiowski Date: Mon, 8 Apr 2013 22:00:02 +0000 (+0200) Subject: Separate test/unit/wrap.js; make tests not fail when wrap module excluded X-Git-Tag: 2.0.0-beta3~5 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=bea0d9a49df88e382805df08c5431a5e1a0752c9;p=jquery.git Separate test/unit/wrap.js; make tests not fail when wrap module excluded --- diff --git a/test/index.html b/test/index.html index 14e686034..cf9590a61 100644 --- a/test/index.html +++ b/test/index.html @@ -57,6 +57,7 @@ + diff --git a/test/unit/manipulation.js b/test/unit/manipulation.js index 6093dbfb6..a15c4c5ad 100644 --- a/test/unit/manipulation.js +++ b/test/unit/manipulation.js @@ -103,234 +103,6 @@ test( "text(Function) with incoming value", function() { equal( jQuery("#sap").text(), "foobar", "Check for merged text of more then one element." ); }); -if ( jQuery.fn.wrap ) { - - var testWrap = function( val ) { - - expect( 19 ); - - var defaultText, result, j, i, cacheLength; - - defaultText = "Try them out:", - result = jQuery("#first").wrap( val("
") ).text(); - - equal( defaultText, result, "Check for wrapping of on-the-fly html" ); - ok( jQuery("#first").parent().parent().is(".red"), "Check if wrapper has class 'red'" ); - - QUnit.reset(); - result = jQuery("#first").wrap( val(document.getElementById("empty")) ).parent(); - ok( result.is("ol"), "Check for element wrapping" ); - equal( result.text(), defaultText, "Check for element wrapping" ); - - QUnit.reset(); - jQuery("#check1").on( "click", function() { - var checkbox = this; - - ok( checkbox.checked, "Checkbox's state is erased after wrap() action, see #769" ); - jQuery( checkbox ).wrap( val("") ); - ok( checkbox.checked, "Checkbox's state is erased after wrap() action, see #769" ); - }).prop( "checked", false )[ 0 ].click(); - - // using contents will get comments regular, text, and comment nodes - j = jQuery("#nonnodes").contents(); - j.wrap( val("") ); - - // Blackberry 4.6 doesn't maintain comments in the DOM - equal( jQuery("#nonnodes > i").length, jQuery("#nonnodes")[ 0 ].childNodes.length, "Check node,textnode,comment wraps ok" ); - equal( jQuery("#nonnodes > i").text(), j.text(), "Check node,textnode,comment wraps doesn't hurt text" ); - - // Try wrapping a disconnected node - cacheLength = 0; - for ( i in jQuery.cache ) { - cacheLength++; - } - - j = jQuery("