mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/MinervaNeue
synced 2024-11-17 11:13:34 +00:00
d407d1054c
Most of these are captured in other bugs The anon talk message style doesn't do anything. Bug: T344022 Change-Id: Iba1fce98ea05931fe07b2b20f07c62d198039d1b
41 lines
1.5 KiB
JavaScript
41 lines
1.5 KiB
JavaScript
( function ( M ) {
|
|
var
|
|
mobile = M.require( 'mobile.startup' ),
|
|
pageIssues = require( '../../../../resources/skins.minerva.scripts/page-issues/index.js' ),
|
|
insertBannersOrNotice = pageIssues.test.insertBannersOrNotice,
|
|
OverlayManager = mobile.OverlayManager,
|
|
PageHTMLParser = mobile.PageHTMLParser,
|
|
overlayManager = OverlayManager.getSingleton(),
|
|
$mockContainer = $(
|
|
'<div id=\'bodyContent\'>' +
|
|
'<table class=\'ambox ambox-content\'>' +
|
|
'<tbody class=\'mbox-text\'>' +
|
|
'<tr><td><span class=\'mbox-text-span\'> ambox text span </span></td></tr>' +
|
|
'</tbody>' +
|
|
'</table>' +
|
|
'</div>'
|
|
),
|
|
labelText = 'label text',
|
|
inline = true,
|
|
SECTION = '0',
|
|
processedAmbox = insertBannersOrNotice(
|
|
new PageHTMLParser( $mockContainer ),
|
|
labelText, SECTION, inline, overlayManager
|
|
).ambox;
|
|
|
|
QUnit.module( 'Minerva pageIssues' );
|
|
|
|
QUnit.test( 'insertBannersOrNotice() should add a "learn more" message', function ( assert ) {
|
|
assert.true( /⧼skin-minerva-issue-learn-more⧽/.test( processedAmbox.html() ) );
|
|
} );
|
|
|
|
QUnit.test( 'insertBannersOrNotice() should add an icon', function ( assert ) {
|
|
// FIXME: Remove mw-ui-icon when T346184 and/or T346162 has been resolved.
|
|
assert.true( /(mw-ui-icon|mf-icon)/.test( processedAmbox.html() ) );
|
|
} );
|
|
QUnit.test( 'clicking on the product of insertBannersOrNotice() should trigger a URL change', function ( assert ) {
|
|
processedAmbox.click();
|
|
assert.strictEqual( window.location.hash, '#/issues/' + SECTION );
|
|
} );
|
|
}( mw.mobileFrontend ) );
|