diff options
author | Oleg <markelog@gmail.com> | 2013-01-16 22:07:53 +0400 |
---|---|---|
committer | Dave Methvin <dave.methvin@gmail.com> | 2013-01-20 18:30:56 -0500 |
commit | 19def21df41d6be6419e4d2480a656d9e1a0e6b7 (patch) | |
tree | 6842bc6fe513630008b42cd17cf59be1217bcc3e /test/unit/manipulation.js | |
parent | dbf4926e31390ceda57730c68d40f34536803114 (diff) | |
download | jquery-19def21df41d6be6419e4d2480a656d9e1a0e6b7.tar.gz jquery-19def21df41d6be6419e4d2480a656d9e1a0e6b7.zip |
Fix #13232, fix jQuery.buildFragment for tables, close gh-1138.
Diffstat (limited to 'test/unit/manipulation.js')
-rw-r--r-- | test/unit/manipulation.js | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/test/unit/manipulation.js b/test/unit/manipulation.js index c5bee2ca9..fdbae76d7 100644 --- a/test/unit/manipulation.js +++ b/test/unit/manipulation.js @@ -2196,3 +2196,32 @@ test( "Make sure jQuery.fn.remove can work on elements in documentFragment", 1, equal( fragment.childNodes.length, 0, "div element was removed from documentFragment" ); }); + +test( "Make sure specific elements with content created correctly (#13232)", 20, function() { + var results = [], + args = [], + elems = { + thead: "<tr><td>thead</td></tr>", + tbody: "<tr><td>tbody</td></tr>", + tfoot: "<tr><td>tfoot</td></tr>", + colgroup: "<col span='5' />", + caption: "caption", + tr: "<td>tr</td>", + th: "th", + td: "<div>td</div>", + optgroup: "<option>optgroup</option>", + option: "option" + }; + + jQuery.each( elems, function( name, value ) { + var html = "<" + name + ">" + value + "</" + name + ">"; + ok( jQuery.nodeName( jQuery.parseHTML( "<" + name + ">" + value + "</" + name + ">" )[ 0 ], name ), name + " is created correctly" ); + + results.push( name ); + args.push( html ); + }); + + jQuery.fn.append.apply( jQuery("<div/>"), args ).children().each(function( i ) { + ok( jQuery.nodeName( this, results[ i ] ) ); + }); +}); |