Files
mediawiki-extensions-Univer…/tests/qunit/ext.uls.tests.js
Amir E. Aharoni 03df48a609 Created script groups, introduce $.uls.data
Gave script groups clear names and sorted them.
Documentation in comments.
Add tests to check that no script has been left behind.
Corrected Lath to Latn (thanks to testing).

Rename langdb.js to ext.uls.data.js

Add ResourceLoader module ext.uls.data

Change-Id: I91fafa94ffd1eaf2d12c954fe3a71064276533f9
2012-06-27 15:08:07 +05:30

41 lines
926 B
JavaScript

/**
* QUnit tests for ULS
*
* @file
* @author Santhosh Thottingal
* @copyright Copyright © 2012 Santhosh Thottingal
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
*/
( function () {
module( "ext.uls", QUnit.newMwEnvironment() );
/*
* Runs over all script codes mentioned in langdb and checks whether
* they belong to the 'Other' group.
*/
var orphanScript = function () {
for ( var language in $.uls.data.languages ) {
var script = $.uls.data.languages[language][0];
if ( $.uls.data.groupOfScript( script ) === 'Other' ) {
return script;
}
}
return '';
}
test( "-- Initial check", function() {
expect( 1 );
ok( $.fn.uls, "$.fn.uls is defined" );
} );
test( "-- $.uls.data testing", function() {
expect( 1 );
// Unless we actually want some scripts to be in the 'Other' group.
strictEqual( orphanScript(), '', 'No orphan scripts found.' );
} );
}());