X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;ds=inline;f=test%2Funit%2Fmanipulation.js;h=4631ead61eac05a8142aec381f4b0e51a79da61d;hb=f6a0bf6816f4e2e67382b1b13fdd3ff2ea4b22f8;hp=44fafa92b1cb09eb3838b18dcf70989145abe546;hpb=209278915592fc63bd62039e246046d446d329e0;p=jquery.git
diff --git a/test/unit/manipulation.js b/test/unit/manipulation.js
index 44fafa9..4631ead 100644
--- a/test/unit/manipulation.js
+++ b/test/unit/manipulation.js
@@ -13,7 +13,7 @@ test("text()", function() {
});
var testWrap = function(val) {
- expect(15);
+ expect(18);
var defaultText = 'Try them out:'
var result = jQuery('#first').wrap(val( '
' )).text();
equals( defaultText, result, 'Check for wrapping of on-the-fly html' );
@@ -54,6 +54,20 @@ var testWrap = function(val) {
equals( j[0].parentNode.parentNode.childNodes.length, 1, "There should only be one element wrapping." );
equals( j.length, 1, "There should only be one element (no cloning)." );
equals( j[0].parentNode.nodeName.toUpperCase(), "P", "The span should be in the paragraph." );
+
+ // Wrap an element with a jQuery set
+ j = jQuery("").wrap(jQuery(""));
+ equals( j[0].parentNode.nodeName.toLowerCase(), "div", "Wrapping works." );
+
+ // Wrap an element with a jQuery set and event
+ result = jQuery("").click(function(){
+ ok(true, "Event triggered.");
+ });
+
+ j = jQuery("").wrap(result);
+ equals( j[0].parentNode.nodeName.toLowerCase(), "div", "Wrapping works." );
+
+ j.parent().trigger("click");
}
test("wrap(String|Element)", function() {