@@ -650,7 +650,7 @@ test("insertAfter(String|Element|Array<Element>|jQuery)", function() {
650650} ) ;
651651
652652var testReplaceWith = function ( val ) {
653- expect ( 15 ) ;
653+ expect ( 17 ) ;
654654 jQuery ( '#yahoo' ) . replaceWith ( val ( '<b id="replace">buga</b>' ) ) ;
655655 ok ( jQuery ( "#replace" ) [ 0 ] , 'Replace element with string' ) ;
656656 ok ( ! jQuery ( "#yahoo" ) [ 0 ] , 'Verify that original element is gone, after string' ) ;
@@ -660,6 +660,11 @@ var testReplaceWith = function(val) {
660660 ok ( jQuery ( "#first" ) [ 0 ] , 'Replace element with element' ) ;
661661 ok ( ! jQuery ( "#yahoo" ) [ 0 ] , 'Verify that original element is gone, after element' ) ;
662662
663+ reset ( ) ;
664+ jQuery ( '#baz' ) . replaceWith ( "Baz" ) ;
665+ equals ( jQuery ( "#bar" ) . text ( ) , "Baz" , 'Replace element with text' ) ;
666+ ok ( ! jQuery ( "#baz" ) [ 0 ] , 'Verify that original element is gone, after element' ) ;
667+
663668 reset ( ) ;
664669 jQuery ( '#yahoo' ) . replaceWith ( val ( [ document . getElementById ( 'first' ) , document . getElementById ( 'mark' ) ] ) ) ;
665670 ok ( jQuery ( "#first" ) [ 0 ] , 'Replace element with array of elements' ) ;
@@ -721,7 +726,7 @@ test("replaceWith(String|Element|Array<Element>|jQuery)", function() {
721726test ( "replaceWith(Function)" , function ( ) {
722727 testReplaceWith ( functionReturningObj ) ;
723728
724- expect ( 16 ) ;
729+ expect ( 18 ) ;
725730
726731 var y = jQuery ( "#yahoo" ) [ 0 ] ;
727732
0 commit comments