});
reset();
-})
+});
+
+test("replaceWith(string) for more than one element", function(){
+ expect(3);
+
+ equals(jQuery('#foo p').length, 3, 'ensuring that test data has not changed');
+
+ jQuery('#foo p').replaceWith('<span>bar</span>');
+ equals(jQuery('#foo span').length, 3, 'verify that all the three original element have been replaced');
+ equals(jQuery('#foo p').length, 0, 'verify that all the three original element have been replaced');
+});
test("replaceAll(String|Element|Array<Element>|jQuery)", function() {
expect(10);
}
var testHtml = function(valueObj) {
- expect(24);
+ expect(26);
jQuery.scriptorder = 0;
equals( div.children().length, 2, "Make sure two child nodes exist." );
equals( div.children().children().length, 1, "Make sure that a grandchild exists." );
+ equals( jQuery("<div/>").html(valueObj(" "))[0].innerHTML, " ", "Make sure entities are passed through correctly." );
+ equals( jQuery("<div/>").html(valueObj("&"))[0].innerHTML, "&", "Make sure entities are passed through correctly." );
+
reset();
// using contents will get comments regular, text, and comment nodes
var j = jQuery("#nonnodes").contents();