mediawiki-skins-MinervaNeue/tests/qunit/skins.minerva.scripts/test_PageIssuesOverlay.js
Ed Sanders 04a2b27d7f build: Update linters
This exposes two broken tests:

* #setCount (Eastern Arabic numerals)
* clicking on the product of createBanner() should trigger a custom event

that were previously passing due to buggy assertions.

Change-Id: If18ad1ff9363fff65d3e347c01ce4bc0669b2a0e
2018-09-11 13:42:11 -07:00

37 lines
982 B
JavaScript

( function ( M ) {
var PageIssuesOverlay = M.require( 'skins.minerva.scripts/PageIssuesOverlay' );
QUnit.module( 'Minerva PageIssuesOverlay', {
beforeEach: function () {
this.logger = {
log: this.sandbox.spy()
};
}
} );
QUnit.test( '#log (section=all)', function ( assert ) {
var overlay = new PageIssuesOverlay( [], this.logger, 'all', 0 );
overlay.onExit();
assert.strictEqual( this.logger.log.calledOnce, true, 'Logger called once' );
assert.strictEqual(
this.logger.log.calledWith( {
action: 'modalClose',
issuesSeverity: []
} ), true, 'sectionNumbers is not set (T202940)'
);
} );
QUnit.test( '#log (section=1)', function ( assert ) {
var overlay = new PageIssuesOverlay( [], this.logger, '1', 0 );
overlay.onExit();
assert.strictEqual(
this.logger.log.calledWith( {
action: 'modalClose',
issuesSeverity: [],
sectionNumbers: [ '1' ]
} ), true, 'sectionNumbers is set'
);
} );
}( mw.mobileFrontend ) );