mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/RevisionSlider
synced 2024-12-12 07:25:13 +00:00
Merge "Check if QUnit tests are language-setting-proof"
This commit is contained in:
commit
cd602086c8
|
@ -167,24 +167,18 @@
|
||||||
|
|
||||||
QUnit.test( 'big change number is formatted correctly', function ( assert ) {
|
QUnit.test( 'big change number is formatted correctly', function ( assert ) {
|
||||||
var revisionListView = new RevisionListView(),
|
var revisionListView = new RevisionListView(),
|
||||||
originalUserLangSetting = mw.config.get( 'wgUserLanguage' ),
|
|
||||||
$changeSizeLineHtml;
|
$changeSizeLineHtml;
|
||||||
|
|
||||||
mw.config.set( 'wgUserLanguage', 'en' );
|
|
||||||
$changeSizeLineHtml = revisionListView.makeChangeSizeLine( 1000 );
|
$changeSizeLineHtml = revisionListView.makeChangeSizeLine( 1000 );
|
||||||
mw.config.set( 'wgUserLanguage', originalUserLangSetting );
|
|
||||||
|
|
||||||
assert.equal( $changeSizeLineHtml.find( '.mw-revslider-change-positive' ).text(), '+1,000' );
|
assert.equal( $changeSizeLineHtml.find( '.mw-revslider-change-positive' ).text(), '+1,000' );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
QUnit.test( 'page size is formatted correctly', function ( assert ) {
|
QUnit.test( 'page size is formatted correctly', function ( assert ) {
|
||||||
var revisionListView = new RevisionListView(),
|
var revisionListView = new RevisionListView(),
|
||||||
originalUserLangSetting = mw.config.get( 'wgUserLanguage' ),
|
|
||||||
$pageSizeLineHtml;
|
$pageSizeLineHtml;
|
||||||
|
|
||||||
mw.config.set( 'wgUserLanguage', 'en' );
|
|
||||||
$pageSizeLineHtml = revisionListView.makePageSizeLine( 1337 );
|
$pageSizeLineHtml = revisionListView.makePageSizeLine( 1337 );
|
||||||
mw.config.set( 'wgUserLanguage', originalUserLangSetting );
|
|
||||||
|
|
||||||
assert.ok( $pageSizeLineHtml.text().match( /1,337/ ) );
|
assert.ok( $pageSizeLineHtml.text().match( /1,337/ ) );
|
||||||
} );
|
} );
|
||||||
|
|
Loading…
Reference in a new issue