Bmansurov has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/169020

Change subject: fix failing tests
......................................................................

fix failing tests

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


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/20/169020/1

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: newchange
Gerrit-Change-Id: I0b8e9f8e0fbe76740817b620113c10ce1acf83e7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Bmansurov <[email protected]>

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

Reply via email to