aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit
diff options
context:
space:
mode:
authorjeresig <jeresig@gmail.com>2010-01-11 16:31:31 -0500
committerjeresig <jeresig@gmail.com>2010-01-11 16:31:31 -0500
commit23d600c66d8e1f7298dcb46eedba862279cd251d (patch)
treebcb2ef8516d0712e08776f29bd4d77b576dda3f5 /test/unit
parent3e9ef6f5c08e63a90ef2dfd3bdc833994e7a0ac8 (diff)
downloadjquery-23d600c66d8e1f7298dcb46eedba862279cd251d.tar.gz
jquery-23d600c66d8e1f7298dcb46eedba862279cd251d.zip
Make sure that wrapInner works on elements that have no contents. Fixes #3552.
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/manipulation.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/test/unit/manipulation.js b/test/unit/manipulation.js
index 3eef1221c..a0239a405 100644
--- a/test/unit/manipulation.js
+++ b/test/unit/manipulation.js
@@ -145,7 +145,7 @@ test("wrapAll(String|Element)", function() {
// })
var testWrapInner = function(val) {
- expect(6);
+ expect(8);
var num = jQuery("#first").children().length;
var result = jQuery('#first').wrapInner('<div class="red"><div id="tmp"></div></div>');
equals( jQuery("#first").children().length, 1, "Only one child" );
@@ -158,6 +158,11 @@ var testWrapInner = function(val) {
equals( jQuery("#first").children().length, 1, "Only one child" );
ok( jQuery("#first").children().is("#empty"), "Verify Right Element" );
equals( jQuery("#first").children().children().length, num, "Verify Elements Intact" );
+
+ var div = jQuery("<div/>");
+ div.wrapInner("<span></span>");
+ equals(div.children().length, 1, "The contents were wrapped.");
+ equals(div.children()[0].nodeName.toLowerCase(), "span", "A span was inserted.");
}
test("wrapInner(String|Element)", function() {