mediawiki-skins-MinervaNeue/tests/qunit/skins.minerva.scripts/test_utils.js
jdlrobson cfd5fbbde8 Add icons for all the types of issues
More hackery!
This adds some tests and ensures that our own icons are mapped to the
existing template icons.

Bug: T187916
Change-Id: I49073f22995c6730369235d6039939915ba2079c
2018-03-15 15:02:05 -07:00

48 lines
938 B
JavaScript

( function ( M ) {
var utils = M.require( 'skins.minerva.scripts/utils' ),
getIconFromAmbox = utils.getIconFromAmbox;
QUnit.module( 'Minerva utils' );
QUnit.test( 'getIconFromAmbox', function ( assert ) {
var tests = [
[
'', 'issue-default'
],
[
'ambox', 'issue-default'
],
[
'ambox-content ambox-speedy', 'issue-speedy'
],
[
'ambox-content ambox-delete', 'issue-delete'
],
[
'ambox-content', 'issue-content'
],
[
'ambox-content ambox-pov', 'issue-pov'
],
[
'ambox-content ambox-style', 'issue-style'
],
[
'ambox-content ambox-move', 'issue-move'
],
[
'ambox-content ambox-protection', 'issue-protection'
]
];
tests.forEach( function ( test, i ) {
var $box = $( '<div>' );
$box.addClass( test[0] );
assert.strictEqual(
getIconFromAmbox( $box ).options.name,
test[1],
i
);
} );
} );
}( mw.mobileFrontend ) );