mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/RevisionSlider
synced 2024-12-13 07:48:37 +00:00
Merge "Revert "Reset custom separator transform tables in number formatting tests""
This commit is contained in:
commit
6768cda9ee
|
@ -65,18 +65,14 @@
|
||||||
minor: true
|
minor: true
|
||||||
} ),
|
} ),
|
||||||
tooltip,
|
tooltip,
|
||||||
tooltipHtml,
|
tooltipHtml;
|
||||||
originalSeparatorTransformTable = mw.language.getData( 'en', 'separatorTransformTable' );
|
|
||||||
|
|
||||||
revision.setRelativeSize( 2100 );
|
revision.setRelativeSize( 2100 );
|
||||||
|
|
||||||
mw.libs.revisionSlider.userOffset = 0;
|
mw.libs.revisionSlider.userOffset = 0;
|
||||||
|
|
||||||
mw.language.setData( 'en', 'separatorTransformTable', null );
|
|
||||||
|
|
||||||
tooltip = revisionListView.makeTooltip( revision );
|
tooltip = revisionListView.makeTooltip( revision );
|
||||||
tooltipHtml = tooltip.$element.html();
|
tooltipHtml = tooltip.$element.html();
|
||||||
mw.language.setData( 'en', 'separatorTransformTable', originalSeparatorTransformTable );
|
|
||||||
|
|
||||||
assert.ok( tooltipHtml.match( /User1/ ), 'Test the user.' );
|
assert.ok( tooltipHtml.match( /User1/ ), 'Test the user.' );
|
||||||
assert.ok( tooltipHtml.match( /Hello/ ), 'Test the comment.' );
|
assert.ok( tooltipHtml.match( /Hello/ ), 'Test the comment.' );
|
||||||
|
@ -84,7 +80,6 @@
|
||||||
assert.ok( tooltipHtml.match( /\+2,100/ ), 'Test the change size.' );
|
assert.ok( tooltipHtml.match( /\+2,100/ ), 'Test the change size.' );
|
||||||
assert.ok( tooltipHtml.match( /26 April 2016 10:27 AM/ ), 'Test the date.' );
|
assert.ok( tooltipHtml.match( /26 April 2016 10:27 AM/ ), 'Test the date.' );
|
||||||
assert.ok( tooltipHtml.match( /minor/ ), 'Test minor.' );
|
assert.ok( tooltipHtml.match( /minor/ ), 'Test minor.' );
|
||||||
|
|
||||||
}, mw.config.get( 'wgUserLanguage' ) !== 'en' );
|
}, mw.config.get( 'wgUserLanguage' ) !== 'en' );
|
||||||
|
|
||||||
QUnit.test( 'empty user leads to no user line', function ( assert ) {
|
QUnit.test( 'empty user leads to no user line', function ( assert ) {
|
||||||
|
@ -173,14 +168,11 @@
|
||||||
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' ),
|
originalUserLangSetting = mw.config.get( 'wgUserLanguage' ),
|
||||||
originalSeparatorTransformTable = mw.language.getData( 'en', 'separatorTransformTable' ),
|
|
||||||
$changeSizeLineHtml;
|
$changeSizeLineHtml;
|
||||||
|
|
||||||
mw.config.set( 'wgUserLanguage', 'en' );
|
mw.config.set( 'wgUserLanguage', 'en' );
|
||||||
mw.language.setData( 'en', 'separatorTransformTable', null );
|
|
||||||
$changeSizeLineHtml = revisionListView.makeChangeSizeLine( 1000 );
|
$changeSizeLineHtml = revisionListView.makeChangeSizeLine( 1000 );
|
||||||
mw.config.set( 'wgUserLanguage', originalUserLangSetting );
|
mw.config.set( 'wgUserLanguage', originalUserLangSetting );
|
||||||
mw.language.setData( 'en', 'separatorTransformTable', originalSeparatorTransformTable );
|
|
||||||
|
|
||||||
assert.equal( $changeSizeLineHtml.find( '.mw-revslider-change-positive' ).text(), '+1,000' );
|
assert.equal( $changeSizeLineHtml.find( '.mw-revslider-change-positive' ).text(), '+1,000' );
|
||||||
} );
|
} );
|
||||||
|
@ -188,14 +180,11 @@
|
||||||
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' ),
|
originalUserLangSetting = mw.config.get( 'wgUserLanguage' ),
|
||||||
originalSeparatorTransformTable = mw.language.getData( 'en', 'separatorTransformTable' ),
|
|
||||||
$pageSizeLineHtml;
|
$pageSizeLineHtml;
|
||||||
|
|
||||||
mw.config.set( 'wgUserLanguage', 'en' );
|
mw.config.set( 'wgUserLanguage', 'en' );
|
||||||
mw.language.setData( 'en', 'separatorTransformTable', null );
|
|
||||||
$pageSizeLineHtml = revisionListView.makePageSizeLine( 1337 );
|
$pageSizeLineHtml = revisionListView.makePageSizeLine( 1337 );
|
||||||
mw.config.set( 'wgUserLanguage', originalUserLangSetting );
|
mw.config.set( 'wgUserLanguage', originalUserLangSetting );
|
||||||
mw.language.setData( 'en', 'separatorTransformTable', originalSeparatorTransformTable );
|
|
||||||
|
|
||||||
assert.ok( $pageSizeLineHtml.text().match( /1,337/ ) );
|
assert.ok( $pageSizeLineHtml.text().match( /1,337/ ) );
|
||||||
} );
|
} );
|
||||||
|
|
Loading…
Reference in a new issue