mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/MinervaNeue
synced 2024-12-11 05:46:09 +00:00
cfd5fbbde8
More hackery! This adds some tests and ensures that our own icons are mapped to the existing template icons. Bug: T187916 Change-Id: I49073f22995c6730369235d6039939915ba2079c
48 lines
938 B
JavaScript
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 ) );
|