X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=test%2Funit%2Fmanipulation.js;h=bbf9a3a25e747f720e5a23fa01a659c8cb052bc9;hb=9f17e70ae95cc2d4b945bc94283b87cc5b8b23db;hp=b0a1c71af2f4067e5823a46db8f5bf33a7198a6c;hpb=55a64cf095b295d334010c6e0a00863f307caffa;p=jquery.git
diff --git a/test/unit/manipulation.js b/test/unit/manipulation.js
index b0a1c71..bbf9a3a 100644
--- a/test/unit/manipulation.js
+++ b/test/unit/manipulation.js
@@ -140,22 +140,29 @@ test("wrapAll(String|Element)", function() {
});
var testWrapInner = function(val) {
- expect(8);
+ expect(11);
var num = jQuery("#first").children().length;
- var result = jQuery('#first').wrapInner('
');
+ var result = jQuery('#first').wrapInner(val(''));
+ equals( jQuery("#first").children().length, 1, "Only one child" );
+ ok( jQuery("#first").children().is(".red"), "Verify Right Element" );
+ equals( jQuery("#first").children().children().children().length, num, "Verify Elements Intact" );
+
+ reset();
+ var num = jQuery("#first").html("footest
test2
").children().length;
+ var result = jQuery('#first').wrapInner(val(''));
equals( jQuery("#first").children().length, 1, "Only one child" );
ok( jQuery("#first").children().is(".red"), "Verify Right Element" );
equals( jQuery("#first").children().children().children().length, num, "Verify Elements Intact" );
reset();
var num = jQuery("#first").children().length;
- var result = jQuery('#first').wrapInner(document.getElementById('empty'));
+ var result = jQuery('#first').wrapInner(val(document.getElementById('empty')));
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.wrapInner("");
+ div.wrapInner(val(""));
equals(div.children().length, 1, "The contents were wrapped.");
equals(div.children()[0].nodeName.toLowerCase(), "span", "A span was inserted.");
}
@@ -164,10 +171,9 @@ test("wrapInner(String|Element)", function() {
testWrapInner(bareObj);
});
-// TODO: wrapInner uses wrapAll -- get wrapAll working with Function
-// test("wrapInner(Function)", function() {
-// testWrapInner(functionReturningObj)
-// })
+test("wrapInner(Function)", function() {
+ testWrapInner(functionReturningObj)
+});
test("unwrap()", function() {
expect(9);