r90619 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r90618‎ | r90619 | r90620 >
Date:22:24, 22 June 2011
Author:brion
Status:ok
Tags:
Comment:
Followup r87243: qunit test cases for bug 28775 (German-style date sorting)
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
@@ -163,4 +163,59 @@
164164 }
165165 );
166166
167 -})();
\ No newline at end of file
 167+
 168+// Regression tests!
 169+tableTest(
 170+ 'Bug 28775: German-style short numeric dates',
 171+ ['Date'],
 172+ [
 173+ // German-style dates are day-month-year
 174+ ['11.11.2011'],
 175+ ['01.11.2011'],
 176+ ['02.10.2011'],
 177+ ['03.08.2011'],
 178+ ['09.11.2011']
 179+ ],
 180+ [
 181+ // Sorted by ascending date
 182+ ['03.08.2011'],
 183+ ['02.10.2011'],
 184+ ['01.11.2011'],
 185+ ['09.11.2011'],
 186+ ['11.11.2011']
 187+ ],
 188+ function( $table ) {
 189+ // @fixme reset it at end or change module to allow us to override it
 190+ mw.config.set('wgDefaultDateFormat', window.wgDefaultDateFormat = 'dmy');
 191+ $table.tablesorter();
 192+ $table.find('.headerSort:eq(0)').click();
 193+ }
 194+);
 195+tableTest(
 196+ 'Bug 28775: American-style short numeric dates',
 197+ ['Date'],
 198+ [
 199+ // American-style dates are month-day-year
 200+ ['11.11.2011'],
 201+ ['01.11.2011'],
 202+ ['02.10.2011'],
 203+ ['03.08.2011'],
 204+ ['09.11.2011']
 205+ ],
 206+ [
 207+ // Sorted by ascending date
 208+ ['01.11.2011'],
 209+ ['02.10.2011'],
 210+ ['03.08.2011'],
 211+ ['09.11.2011'],
 212+ ['11.11.2011']
 213+ ],
 214+ function( $table ) {
 215+ // @fixme reset it at end or change module to allow us to override it
 216+ mw.config.set('wgDefaultDateFormat', window.wgDefaultDateFormat = 'mdy');
 217+ $table.tablesorter();
 218+ $table.find('.headerSort:eq(0)').click();
 219+ }
 220+);
 221+
 222+})();

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r86088Completely rewritten table sorting script....diebuche21:47, 14 April 2011
r87243Make jquery.tablesorter more resilient by checking multiple cells before assu...diebuche11:31, 2 May 2011

Status & tagging log