diff options
author | Richard Gibson <richard.gibson@gmail.com> | 2013-01-16 12:55:56 -0500 |
---|---|---|
committer | Richard Gibson <richard.gibson@gmail.com> | 2013-01-16 13:54:01 -0500 |
commit | 6b1b0a26b4d485b4d9f334286efed5dfe33e3f3f (patch) | |
tree | 54f520ec6491fef8e7fa0b6027e1ec38d49c8253 /test/unit/manipulation.js | |
parent | 13468abaeb5488d547bc75d99bc3425ee891859e (diff) | |
download | jquery-6b1b0a26b4d485b4d9f334286efed5dfe33e3f3f.tar.gz jquery-6b1b0a26b4d485b4d9f334286efed5dfe33e3f3f.zip |
Fix #13233: re-allow .replaceWith of text nodes. Close gh-1137.
Diffstat (limited to 'test/unit/manipulation.js')
-rw-r--r-- | test/unit/manipulation.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/test/unit/manipulation.js b/test/unit/manipulation.js index aac966731..3ee260d7e 100644 --- a/test/unit/manipulation.js +++ b/test/unit/manipulation.js @@ -1149,7 +1149,7 @@ test( "insertAfter(String|Element|Array<Element>|jQuery)", function() { var testReplaceWith = function( val ) { var tmp, y, child, child2, set, non_existent, $div, - expected = 22; + expected = 23; expect( expected ); @@ -1176,6 +1176,10 @@ var testReplaceWith = function( val ) { ok( jQuery("#mark")[ 0 ], "Replace element with set of elements" ); ok( !jQuery("#groups")[ 0 ], "Verify that original element is gone, after set of elements" ); + tmp = jQuery("<b>content</b>")[0]; + jQuery("#anchor1").contents().replaceWith( val(tmp) ); + deepEqual( jQuery("#anchor1").contents().get(), [ tmp ], "Replace text node with element" ); + tmp = jQuery("<div/>").appendTo("#qunit-fixture").click(function() { ok( true, "Newly bound click run." ); |