http://www.mediawiki.org/wiki/Special:Code/MediaWiki/90619
Revision: 90619
Author: brion
Date: 2011-06-22 22:24:49 +0000 (Wed, 22 Jun 2011)
Log Message:
-----------
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:
trunk/phase3/tests/qunit/suites/resources/jquery/jquery.tablesorter.test.js
===================================================================
--- trunk/phase3/tests/qunit/suites/resources/jquery/jquery.tablesorter.test.js
2011-06-22 22:21:57 UTC (rev 90618)
+++ trunk/phase3/tests/qunit/suites/resources/jquery/jquery.tablesorter.test.js
2011-06-22 22:24:49 UTC (rev 90619)
@@ -163,4 +163,59 @@
}
);
-})();
\ 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();
+ }
+);
+
+})();
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs