aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorOleg Gaidarenko <markelog@gmail.com>2015-12-22 17:35:23 +0300
committerOleg Gaidarenko <markelog@gmail.com>2015-12-22 17:35:23 +0300
commit04d6895b7b7f9a226d77e5a0028a7f0205a1c254 (patch)
tree5cd50cebf87d1b1dc586158fe961c3305c338ea1 /test
parentc463327a5d0f6d84c14d1d69f794f574e0cbcfd4 (diff)
downloadjquery-04d6895b7b7f9a226d77e5a0028a7f0205a1c254.tar.gz
jquery-04d6895b7b7f9a226d77e5a0028a7f0205a1c254.zip
Revert "Manipulation: make wrapAll funarg execute only once"
This reverts commit 3dcee021603d5c25cd429cb25c2de5046044ca4c.
Diffstat (limited to 'test')
-rw-r--r--test/unit/wrap.js100
1 files changed, 0 insertions, 100 deletions
diff --git a/test/unit/wrap.js b/test/unit/wrap.js
index 28077f3a3..3fa9c438a 100644
--- a/test/unit/wrap.js
+++ b/test/unit/wrap.js
@@ -212,106 +212,6 @@ QUnit.test( "wrapAll(String)", function( assert ) {
} );
-QUnit.test( "wrapAll(Function)", function( assert ) {
- assert.expect( 5 );
-
- var prev = jQuery( "#firstp" )[ 0 ].previousSibling,
- p = jQuery( "#firstp,#first" )[ 0 ].parentNode,
- result = jQuery( "#firstp,#first" ).wrapAll( function() {
- return "<div class='red'><div class='tmp'></div></div>";
- } );
-
- assert.equal(
- result.parent().length, 1, "Check for wrapping of on-the-fly html"
- );
- assert.ok(
- jQuery( "#first" ).parent().parent().is( ".red" ), "Check if wrapper has class 'red'"
- );
- assert.ok(
- jQuery( "#firstp" ).parent().parent().is( ".red" ), "Check if wrapper has class 'red'"
- );
- assert.ok(
- jQuery( "#first" ).parent().parent().parent().is( p ), "Correct Parent"
- );
- assert.strictEqual(
- jQuery( "#first" ).parent().parent()[ 0 ].previousSibling, prev, "Correct Previous Sibling"
- );
-} );
-
-QUnit.test( "wrapAll(Function) check execution characteristics", function( assert ) {
- assert.expect( 3 );
-
- var i = 0;
-
- jQuery( "non-existent" ).wrapAll( function() {
- i++;
- return "";
- } );
-
- assert.ok(
- !i, "should not execute function argument if target element does not exist"
- );
-
- jQuery( "#firstp" ).wrapAll( function( index ) {
- assert.strictEqual(
- this, jQuery( "#firstp" )[ 0 ], "context must be the first found element"
- );
- assert.strictEqual(
- index, undefined, "index argument should not be included in function execution"
- );
- } );
-} );
-
-QUnit.test( "wrapAll(Function)", function( assert ) {
- assert.expect( 5 );
-
- var prev = jQuery( "#firstp" )[ 0 ].previousSibling,
- p = jQuery( "#firstp,#first" )[ 0 ].parentNode,
- result = jQuery( "#firstp,#first" ).wrapAll( function() {
- return "<div class='red'><div class='tmp'></div></div>";
- } );
-
- assert.equal(
- result.parent().length, 1, "Check for wrapping of on-the-fly html"
- );
- assert.ok(
- jQuery( "#first" ).parent().parent().is( ".red" ), "Check if wrapper has class 'red'"
- );
- assert.ok(
- jQuery( "#firstp" ).parent().parent().is( ".red" ), "Check if wrapper has class 'red'"
- );
- assert.ok(
- jQuery( "#first" ).parent().parent().parent().is( p ), "Correct Parent"
- );
- assert.strictEqual(
- jQuery( "#first" ).parent().parent()[ 0 ].previousSibling, prev, "Correct Previous Sibling"
- );
-} );
-
-QUnit.test( "wrapAll(Function) check execution characteristics", function( assert ) {
- assert.expect( 3 );
-
- var i = 0;
-
- jQuery( "non-existent" ).wrapAll( function() {
- i++;
- return "";
- } );
-
- assert.ok(
- !i, "should not execute function argument if target element does not exist"
- );
-
- jQuery( "#firstp" ).wrapAll( function( index ) {
- assert.strictEqual(
- this, jQuery( "#firstp" )[ 0 ], "context must be the first found element"
- );
- assert.strictEqual(
- index, undefined, "index argument should not be included in function execution"
- );
- } );
-} );
-
QUnit.test( "wrapAll(Element)", function( assert ) {
assert.expect( 3 );