r102303 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r102302‎ | r102303 | r102304 >
Date:17:48, 7 November 2011
Author:hashar
Status:resolved (Comments)
Tags:
Comment:
tests for bug 32047 / r102301

In table with class="sortable", thead is before caption
Modified paths:
  • /trunk/phase3/tests/qunit/suites/resources/jquery/jquery.tablesorter.test.js (modified) (history)

Diff [purge]

Index: trunk/phase3/tests/qunit/suites/resources/jquery/jquery.tablesorter.test.js
@@ -381,6 +381,33 @@
382382 }
383383 );
384384
 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=\"&lt;sort-ascending&gt;\" 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+
385412 test( 'data-sort-value attribute, when available, should override sorting position', function() {
386413 var $table, data;
387414

Follow-up revisions

RevisionCommit summaryAuthorDate
r102498Comments out console.log calls...hashar09:01, 9 November 2011
r102710on tablesort, verify <caption> is the first child in the table...hashar22:54, 10 November 2011
r103029REL1_18 MFT r99236, r102301, r102303, r102498, r102710, r102751, r102951, r10...reedy20:58, 14 November 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r102301Fix Bug #32047: in table with class="sortable", thead is before...mah17:33, 7 November 2011

Comments

#Comment by Schnark (talk | contribs)   08:31, 9 November 2011

Please remove the console.logs.

#Comment by Hashar (talk | contribs)   09:02, 9 November 2011

Good catch! I have commented them out with r102498. Thanks!

#Comment by Siebrand (talk | contribs)   20:57, 10 November 2011
#Comment by Hashar (talk | contribs)   22:56, 10 November 2011

In Firefox, the attributes 'title' and 'class' comes in a different sorting order :(

I have rewrote patch in r102710 to verify 'caption' is the first child.

Status & tagging log