Index: trunk/phase3/tests/qunit/suites/resources/jquery/jquery.tablesorter.test.js |
— | — | @@ -486,4 +486,41 @@ |
487 | 487 | |
488 | 488 | }); |
489 | 489 | |
| 490 | +var numbers = [ |
| 491 | + [ '12' ], |
| 492 | + [ '7' ], |
| 493 | + [ '13,000'], |
| 494 | + [ '9' ], |
| 495 | + [ '14' ], |
| 496 | + [ '8.0' ], |
| 497 | +]; |
| 498 | +var numbersAsc = [ |
| 499 | + [ '7' ], |
| 500 | + [ '8.0' ], |
| 501 | + [ '9' ], |
| 502 | + [ '12' ], |
| 503 | + [ '14' ], |
| 504 | + [ '13,000'], |
| 505 | +]; |
| 506 | + |
| 507 | +tableTest( 'bug 8115: sort numbers with commas (ascending)', |
| 508 | + ['Numbers'], numbers, numbersAsc, |
| 509 | + function( $table ) { |
| 510 | + $table.tablesorter(); |
| 511 | + $table.find( '.headerSort:eq(0)' ).click(); |
| 512 | + } |
| 513 | +); |
| 514 | + |
| 515 | +alert( mw.config.get( "wgContentLanguage" ) ); |
| 516 | + |
| 517 | +tableTest( 'bug 8115: sort numbers with commas (descending)', |
| 518 | + ['Numbers'], numbers, reversed(numbersAsc), |
| 519 | + function( $table ) { |
| 520 | + $table.tablesorter(); |
| 521 | + $table.find( '.headerSort:eq(0)' ).click().click(); |
| 522 | + } |
| 523 | +); |
| 524 | +// TODO add numbers sorting tests for bug 8115 with a different language |
| 525 | + |
| 526 | + |
490 | 527 | })(); |