JanZerebecki has uploaded a new change for review. https://gerrit.wikimedia.org/r/277218
Change subject: Make getLanguageNameByCode qunit test work with ULS + cldr enabled ...................................................................... Make getLanguageNameByCode qunit test work with ULS + cldr enabled This is an ugly workaround, but I added comments on what I think is a better solution that we should work on. Bug: T128828 Bug: T92532 Change-Id: I6ed503da8d47d6152fc418106d33984c9406beda (cherry picked from commit f4ccfb2bd30a46a20726f7c07c1f37dc500d85b0) --- M view/tests/qunit/wikibase/wikibase.getLanguageNameByCode.tests.js 1 file changed, 8 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/18/277218/1 diff --git a/view/tests/qunit/wikibase/wikibase.getLanguageNameByCode.tests.js b/view/tests/qunit/wikibase/wikibase.getLanguageNameByCode.tests.js index ff8fac6..f6f94e5 100644 --- a/view/tests/qunit/wikibase/wikibase.getLanguageNameByCode.tests.js +++ b/view/tests/qunit/wikibase/wikibase.getLanguageNameByCode.tests.js @@ -3,17 +3,21 @@ * @author Daniel Werner < [email protected] > */ -( function( wb, $, QUnit ) { +( function( wb, mw, $, QUnit ) { 'use strict'; QUnit.module( 'wikibase.getLanguageNameByCode' ); QUnit.test( 'wikibase.getLanguageNameByCode()', 2, function( assert ) { // TODO: Don't assume global state, control what languages are available for this test! - if( $.uls !== undefined ) { + + // Better might be to turn this into a LanguageNameLookup service and set language + // name in getEntityTermsView in ViewFactory. Then, all places that need language name + // would then have it. + if ( $.uls !== undefined ) { assert.strictEqual( wb.getLanguageNameByCode( 'de' ), - 'Deutsch', + mw.config.get( 'wgULSLanguages' ).de, 'getLanguageNameByCode() returns language name.' ); } else { @@ -31,4 +35,4 @@ ); } ); -}( wikibase, jQuery, QUnit ) ); +}( wikibase, mediaWiki, jQuery, QUnit ) ); -- To view, visit https://gerrit.wikimedia.org/r/277218 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6ed503da8d47d6152fc418106d33984c9406beda Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: REL1_26 Gerrit-Owner: JanZerebecki <[email protected]> Gerrit-Reviewer: Aude <[email protected]> _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
