Skip to content

Commit

Permalink
$.fn.wrap: testing that non-element nodes are supported too
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiospampinato committed Jan 2, 2020
1 parent 949bbbe commit 52bcaea
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/modules/manipulation.js
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,21 @@ describe ( 'Manipulation', { beforeEach: getFixtureInit ( fixture ) }, function

});

it ( 'supports non-element nodes', function ( t ) {

var ele = $('<div id="nonnodes"><span>hi</span> there <!-- mon ami --></div>');
var contents = ele.contents ();

contents.wrap ( '<i></i>' );

console.log ( ele[0].outerHTML );
console.log ( ele.find ( 'i' ) );

t.is ( ele.find ( 'i' ).length, 3 );
t.is ( ele.find ( 'i' ).text (), contents.text () );

});

});

describe ( '$.fn.wrapAll', function ( it ) {
Expand Down

0 comments on commit 52bcaea

Please sign in to comment.