mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/MinervaNeue
synced 2024-12-22 02:23:22 +00:00
dbe79167e5
This reverts commit 548e94da98
.
Reason for revert: The patch was causing the following error on pageload
Error: Cannot require undefined file includes/Skins/ToggleList/ToggleList.js
require startup.js:1006
Bug: T373482
Change-Id: I22751109c124795af7d2e0ad6c4104745b2d6632
39 lines
1.3 KiB
JavaScript
39 lines
1.3 KiB
JavaScript
( function () {
|
|
const
|
|
mobile = require( 'mobile.startup' ),
|
|
pageIssues = require( '../../../../resources/skins.minerva.scripts/page-issues/index.js' ),
|
|
insertBannersOrNotice = pageIssues.test.insertBannersOrNotice,
|
|
PageHTMLParser = mobile.PageHTMLParser,
|
|
overlayManager = mobile.getOverlayManager(),
|
|
$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', ( assert ) => {
|
|
assert.true( /⧼skin-minerva-issue-learn-more⧽/.test( processedAmbox.html() ) );
|
|
} );
|
|
|
|
QUnit.test( 'insertBannersOrNotice() should add an icon', ( assert ) => {
|
|
assert.true( /(minerva-icon)/.test( processedAmbox.html() ) );
|
|
} );
|
|
QUnit.test( 'clicking on the product of insertBannersOrNotice() should trigger a URL change', ( assert ) => {
|
|
processedAmbox.click();
|
|
assert.strictEqual( window.location.hash, '#/issues/' + SECTION );
|
|
} );
|
|
}() );
|