]> source.dussan.org Git - jquery.git/commitdiff
Adding in some more replaceWith tests for #5917.
authorNeeraj Singh <neerajdotname@gmail.com>
Tue, 2 Feb 2010 02:53:31 +0000 (21:53 -0500)
committerjeresig <jeresig@gmail.com>
Tue, 2 Feb 2010 02:53:31 +0000 (21:53 -0500)
test/unit/manipulation.js

index 41ce8bb16c5cc3d839bd46b89ecebe9e1100a820..1e69340b81bdb971e6bc653abb3dc9940170e82d 100644 (file)
@@ -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('<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&lt;Element&gt;|jQuery)", function() {
        expect(10);