From 6ac46d5d5604acfca92672de35f5053bd3b7b855 Mon Sep 17 00:00:00 2001 From: jdlrobson Date: Wed, 12 Sep 2018 14:04:18 -0700 Subject: [PATCH] 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 --- .../test_NotificationBadge.js | 10 ++++++++-- tests/qunit/skins.minerva.scripts/test_pageIssues.js | 11 +++++++---- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/tests/qunit/skins.minerva.notifications.badge/test_NotificationBadge.js b/tests/qunit/skins.minerva.notifications.badge/test_NotificationBadge.js index d59619a..00cc83e 100644 --- a/tests/qunit/skins.minerva.notifications.badge/test_NotificationBadge.js +++ b/tests/qunit/skins.minerva.notifications.badge/test_NotificationBadge.js @@ -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: $( '
۲
' ) } ); diff --git a/tests/qunit/skins.minerva.scripts/test_pageIssues.js b/tests/qunit/skins.minerva.scripts/test_pageIssues.js index b480620..d31df2a 100644 --- a/tests/qunit/skins.minerva.scripts/test_pageIssues.js +++ b/tests/qunit/skins.minerva.scripts/test_pageIssues.js @@ -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 ) {