X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;ds=inline;f=test%2Funit%2Fmanipulation.js;h=e6e6c8d9c5098c8efa9c54c56a382b89c3772585;hb=83a044f1b5a733dc7ea76dbc9b7dd3a3dc4b7f25;hp=41ce8bb16c5cc3d839bd46b89ecebe9e1100a820;hpb=8660ea1ab61dd16aec1ed24ec549c6258292b96a;p=jquery.git diff --git a/test/unit/manipulation.js b/test/unit/manipulation.js index 41ce8bb..e6e6c8d 100644 --- a/test/unit/manipulation.js +++ b/test/unit/manipulation.js @@ -736,7 +736,17 @@ test("replaceWith(Function)", function() { }); 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('bar'); + 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); @@ -841,7 +851,7 @@ test("clone() on XML nodes", function() { } var testHtml = function(valueObj) { - expect(24); + expect(26); jQuery.scriptorder = 0; @@ -858,6 +868,9 @@ var testHtml = function(valueObj) { 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("
").html(valueObj(" "))[0].innerHTML, " ", "Make sure entities are passed through correctly." ); + equals( jQuery("
").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();