Fix skipped tests

If18ad1ff9363fff65d3e347c01ce4bc0669b2a0e introduced some skipped
tests. This restores them.

* NotificationsBadge test was failing due to some failures to stub
* clicking on the product of createBanner failing due to no action occurring
in the test body.

Change-Id: I4c1f407912767737f7cd1e9884a2e7db0baabf75
This commit is contained in:
jdlrobson 2018-09-12 14:04:18 -07:00
parent 04a2b27d7f
commit 6ac46d5d56
2 changed files with 15 additions and 6 deletions

View file

@ -27,8 +27,14 @@
assert.strictEqual( badge.options.notificationCountRaw, 100, 'Number is capped to 100.' );
} );
QUnit.skip( '#setCount (Eastern Arabic numerals)', function ( assert ) {
var badge = new NotificationBadge( {
QUnit.test( '#setCount (Eastern Arabic numerals)', function ( assert ) {
var badge;
this.sandbox.stub( mw.language, 'convertNumber' )
.withArgs( 2 ).returns( '۲' )
.withArgs( 5 ).returns( '۵' );
badge = new NotificationBadge( {
overlayManager: this.OverlayManager,
el: $( '<div><a title="n" href="/" class="notification-unseen"><div class="circle" ><span data-notification-count="2">۲</span></div></a></div>' )
} );

View file

@ -34,9 +34,10 @@
),
labelText = 'label text',
inline = true,
SECTION = '0',
processedAmbox = createBanner(
new Page( { el: $mockContainer } ),
labelText, '0', inline, overlayManager
labelText, SECTION, inline, overlayManager
);
QUnit.module( 'Minerva cleanuptemplates' );
@ -50,18 +51,20 @@
} );
QUnit.test( 'clicking on the product of createBanner() should trigger a URL change', function ( assert ) {
processedAmbox.click();
assert.strictEqual( window.location.hash, '#/issues/0' );
assert.strictEqual( window.location.hash, '#/issues/' + SECTION );
} );
// NOTE: Only for PageIssues AB
QUnit.skip( 'clicking on the product of createBanner() should trigger a custom event', function ( assert ) {
QUnit.test( 'clicking on the product of createBanner() should trigger a custom event', function ( assert ) {
var mockAction = {
action: 'issueClicked',
issueSeverity: [ 'MEDIUM' ]
issuesSeverity: [ 'MEDIUM' ],
sectionNumbers: [ SECTION ]
};
mw.trackSubscribe( 'minerva.PageIssuesAB', function ( topic, data ) {
assert.deepEqual( mockAction, data );
} );
processedAmbox.click();
} );
QUnit.test( 'extractMessage', function ( assert ) {