Kaldari has submitted this change and it was merged.

Change subject: Fix failing tests
......................................................................


Fix failing tests

Bug: 72506
Change-Id: I0b8e9f8e0fbe76740817b620113c10ce1acf83e7
---
M tests/qunit/modules/toggling/test_toggle.js
1 file changed, 10 insertions(+), 0 deletions(-)

Approvals:
  Kaldari: Verified; Looks good to me, approved
  Jdlrobson: Looks good to me, approved



diff --git a/tests/qunit/modules/toggling/test_toggle.js 
b/tests/qunit/modules/toggling/test_toggle.js
index 40b4471..0293d8c 100644
--- a/tests/qunit/modules/toggling/test_toggle.js
+++ b/tests/qunit/modules/toggling/test_toggle.js
@@ -152,6 +152,8 @@
        },
        teardown: function() {
                window.location.hash = "#";
+               M.settings.deleteUserSetting('expandSections', true);
+               M.settings.deleteUserSetting( 'expandedSections', false );
        }
 } );
 
@@ -186,6 +188,9 @@
 
 QUnit.module( 'MobileFrontend toggle.js: remember expanded sections', {
        setup: function() {
+               this.sandbox.stub( mw.config, 'get' ).withArgs( 
'wgMFCollapseSectionsByDefault' ).returns( true );
+               this.sandbox.stub( M, 'isBetaGroupMember' ).returns( true );
+               this.sandbox.stub( M, 'isWideScreen' ).returns( false );
                this.$container = $( '<div>' ).html( sectionHtml );
                toggle.enable( this.$container );
                this.$section = this.$container.find( 'h2' );
@@ -196,6 +201,7 @@
        teardown: function() {
                window.location.hash = "#";
                M.settings.deleteUserSetting( 'expandedSections', false );
+               M.settings.deleteUserSetting('expandSections', true);
        }
 } );
 
@@ -280,6 +286,9 @@
 
 QUnit.module( 'MobileFrontend toggle.js: restore expanded sections', {
        setup: function() {
+               this.sandbox.stub( mw.config, 'get' ).withArgs( 
'wgMFCollapseSectionsByDefault' ).returns( true );
+               this.sandbox.stub( M, 'isBetaGroupMember' ).returns( true );
+               this.sandbox.stub( M, 'isWideScreen' ).returns( false );
                this.$container = $( '<div>' ).html( sectionHtml );
                // Restore expanded sections only works on headings that are 
also section headings
                this.$container.find( 'h2' ).addClass( 'section-heading' );
@@ -291,6 +300,7 @@
        teardown: function() {
                window.location.hash = "#";
                M.settings.deleteUserSetting( 'expandedSections', false );
+               M.settings.deleteUserSetting('expandSections', true);
        }
 } );
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I0b8e9f8e0fbe76740817b620113c10ce1acf83e7
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Bmansurov <bmansu...@wikimedia.org>
Gerrit-Reviewer: Awjrichards <aricha...@wikimedia.org>
Gerrit-Reviewer: Jdlrobson <jrob...@wikimedia.org>
Gerrit-Reviewer: Kaldari <rkald...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to