From: Brion Vibber Date: Wed, 22 Jun 2011 22:24:49 +0000 (+0000) Subject: Followup r87243: qunit test cases for bug 28775 (German-style date sorting) X-Git-Tag: 1.31.0-rc.0~29342 X-Git-Url: http://git.cyclocoop.org/data/Fool?a=commitdiff_plain;h=f42198312a2c485dc4324d09dec5c54140c264ec;p=lhc%2Fweb%2Fwiklou.git Followup r87243: qunit test cases for bug 28775 (German-style date sorting) --- diff --git a/tests/qunit/suites/resources/jquery/jquery.tablesorter.test.js b/tests/qunit/suites/resources/jquery/jquery.tablesorter.test.js index 3c3ba95f8f..a0f73d8521 100644 --- a/tests/qunit/suites/resources/jquery/jquery.tablesorter.test.js +++ b/tests/qunit/suites/resources/jquery/jquery.tablesorter.test.js @@ -163,4 +163,59 @@ tableTest( } ); -})(); \ No newline at end of file + +// Regression tests! +tableTest( + 'Bug 28775: German-style short numeric dates', + ['Date'], + [ + // German-style dates are day-month-year + ['11.11.2011'], + ['01.11.2011'], + ['02.10.2011'], + ['03.08.2011'], + ['09.11.2011'] + ], + [ + // Sorted by ascending date + ['03.08.2011'], + ['02.10.2011'], + ['01.11.2011'], + ['09.11.2011'], + ['11.11.2011'] + ], + function( $table ) { + // @fixme reset it at end or change module to allow us to override it + mw.config.set('wgDefaultDateFormat', window.wgDefaultDateFormat = 'dmy'); + $table.tablesorter(); + $table.find('.headerSort:eq(0)').click(); + } +); +tableTest( + 'Bug 28775: American-style short numeric dates', + ['Date'], + [ + // American-style dates are month-day-year + ['11.11.2011'], + ['01.11.2011'], + ['02.10.2011'], + ['03.08.2011'], + ['09.11.2011'] + ], + [ + // Sorted by ascending date + ['01.11.2011'], + ['02.10.2011'], + ['03.08.2011'], + ['09.11.2011'], + ['11.11.2011'] + ], + function( $table ) { + // @fixme reset it at end or change module to allow us to override it + mw.config.set('wgDefaultDateFormat', window.wgDefaultDateFormat = 'mdy'); + $table.tablesorter(); + $table.find('.headerSort:eq(0)').click(); + } +); + +})();