aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorRichard Gibson <richard.gibson@gmail.com>2013-01-16 12:55:56 -0500
committerRichard Gibson <richard.gibson@gmail.com>2013-01-16 13:57:00 -0500
commita96aa9e2709b4ba132b966a0f1a13d0e8eb49b9a (patch)
tree2399350a8b799e1941c531cf9a15e40d894e3789 /test
parent306b698813c7d999b6f572d8d00b2691952fdea6 (diff)
downloadjquery-a96aa9e2709b4ba132b966a0f1a13d0e8eb49b9a.tar.gz
jquery-a96aa9e2709b4ba132b966a0f1a13d0e8eb49b9a.zip
Fix #13233: re-allow .replaceWith of text nodes. Close gh-1137.
(cherry picked from commit 6b1b0a26b4d485b4d9f334286efed5dfe33e3f3f)
Diffstat (limited to 'test')
-rw-r--r--test/unit/manipulation.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/test/unit/manipulation.js b/test/unit/manipulation.js
index f3040c4fb..c5bee2ca9 100644
--- a/test/unit/manipulation.js
+++ b/test/unit/manipulation.js
@@ -1107,7 +1107,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 );
@@ -1134,6 +1134,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." );