Index: trunk/phase3/tests/qunit/suites/resources/jquery/jquery.tablesorter.test.js |
— | — | @@ -163,4 +163,59 @@ |
164 | 164 | } |
165 | 165 | ); |
166 | 166 | |
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 | +})(); |