Index: trunk/phase3/tests/qunit/suites/resources/jquery/jquery.tablesorter.test.js |
— | — | @@ -381,6 +381,33 @@ |
382 | 382 | } |
383 | 383 | ); |
384 | 384 | |
| 385 | +/** FIXME: the diff output is not very readeable. */ |
| 386 | +test( 'bug 32047 - caption must be before thead', function() { |
| 387 | + var $table; |
| 388 | + $table = $( |
| 389 | + '<table class="sortable">' + |
| 390 | + '<caption>CAPTION</caption>' + |
| 391 | + '<tr><th>THEAD</th></tr>' + |
| 392 | + '<tr><td>A</td></tr>' + |
| 393 | + '<tr><td>B</td></tr>' + |
| 394 | + '<tr class="sortbottom"><td>TFOOT</td></tr>' + |
| 395 | + '</table>' |
| 396 | + ); |
| 397 | + console.log( $table.html() ); |
| 398 | + $table.tablesorter(); |
| 399 | + console.log( $table.html() ); |
| 400 | + var expected = |
| 401 | + '<caption>CAPTION</caption>'+ |
| 402 | + '<thead>' + |
| 403 | + '<tr><th title=\"<sort-ascending>\" class=\"headerSort\">THEAD</th></tr>' + |
| 404 | + '</thead>' + |
| 405 | + '<tbody><tr><td>A</td></tr>' + |
| 406 | + '<tr><td>B</td></tr>' + |
| 407 | + '<tr class=\"sortbottom\"><td>TFOOT</td></tr>' + |
| 408 | + '</tbody><tfoot></tfoot>'; |
| 409 | + deepEqual( $table.html(), expected, '<caption> must be placed before <thead> (bug 32047)' ); |
| 410 | +}); |
| 411 | + |
385 | 412 | test( 'data-sort-value attribute, when available, should override sorting position', function() { |
386 | 413 | var $table, data; |
387 | 414 | |