jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/343768 )

Change subject: tests: Use stub for mw.util instead of manual teardown
......................................................................


tests: Use stub for mw.util instead of manual teardown

Change-Id: Ic8a6fcad07896475557842c530140d3b09a99344
---
M tests/qunit/ext.guidedTour.lib.tests.js
1 file changed, 6 insertions(+), 9 deletions(-)

Approvals:
  jenkins-bot: Verified
  Phuedx: Looks good to me, approved
  Jforrester: Looks good to me, but someone else must approve



diff --git a/tests/qunit/ext.guidedTour.lib.tests.js 
b/tests/qunit/ext.guidedTour.lib.tests.js
index 26f9833..3892da4 100644
--- a/tests/qunit/ext.guidedTour.lib.tests.js
+++ b/tests/qunit/ext.guidedTour.lib.tests.js
@@ -1,7 +1,7 @@
 ( function ( mw, $ ) {
        'use strict';
 
-       var gt, originalVE, originalGetParam, cookieConfig, cookieName, 
cookieParams,
+       var gt, originalVE, cookieConfig, cookieName, cookieParams,
                // Step specification as passed to the legacy defineTour method
                VALID_DEFINE_TOUR_STEP_SPEC = {
                        titlemsg: 'guidedtour-tour-test-callouts',
@@ -42,7 +42,6 @@
 
        QUnit.module( 'ext.guidedTour.lib', QUnit.newMwEnvironment( {
                setup: function () {
-                       originalGetParam = mw.util.getParamValue;
                        originalVE = window.ve;
 
                        validTourBuilder = new gt.TourBuilder( { name: 
'placeholder' } );
@@ -62,7 +61,6 @@
                },
                teardown: function () {
                        window.ve = originalVE;
-                       mw.util.getParamValue = originalGetParam;
                }
        } ) );
 
@@ -94,7 +92,6 @@
                        'Missing parameter returns null'
                );
        } );
-
 
        QUnit.test( 'parseTourId', 1, function ( assert ) {
                var tourId = 'gt-test-2', expectedTourInfo;
@@ -133,9 +130,9 @@
                        PAGE_NAME_TO_SKIP = 'RightPage',
                        OTHER_PAGE_NAME = 'OtherPage';
 
-               mw.util.getParamValue = function ( param ) {
-                       return paramMap[param];
-               };
+               this.sandbox.stub( mw.util, 'getParamValue', function ( param ) 
{
+                       return paramMap[ param ];
+               } );
 
                paramMap = { action: 'edit', debug: 'true' };
 
@@ -188,9 +185,9 @@
 
        QUnit.test( 'getStepFromQuery', 2, function ( assert ) {
                var step;
-               mw.util.getParamValue = function () {
+               this.sandbox.stub( mw.util, 'getParamValue', function () {
                        return step;
-               };
+               } );
 
                step = 6;
                assert.strictEqual(

-- 
To view, visit https://gerrit.wikimedia.org/r/343768
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic8a6fcad07896475557842c530140d3b09a99344
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/GuidedTour
Gerrit-Branch: master
Gerrit-Owner: Krinkle <[email protected]>
Gerrit-Reviewer: Jforrester <[email protected]>
Gerrit-Reviewer: Mattflaschen <[email protected]>
Gerrit-Reviewer: Phuedx <[email protected]>
Gerrit-Reviewer: Swalling <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to