jenkins-bot has submitted this change and it was merged.

Change subject: Re-enable InfiniteScroll and settings tests
......................................................................


Re-enable InfiniteScroll and settings tests

Fixes to make the tests work

Bug: T106628
Change-Id: I729d0a4af9346654269c8855a4102d3fc02484c3
---
M tests/qunit/mobile.infiniteScroll/test_InfiniteScroll.js
M tests/qunit/mobile.settings/test_settings.js
2 files changed, 21 insertions(+), 13 deletions(-)

Approvals:
  Bmansurov: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/tests/qunit/mobile.infiniteScroll/test_InfiniteScroll.js 
b/tests/qunit/mobile.infiniteScroll/test_InfiniteScroll.js
index 4fee431..2ea393e 100644
--- a/tests/qunit/mobile.infiniteScroll/test_InfiniteScroll.js
+++ b/tests/qunit/mobile.infiniteScroll/test_InfiniteScroll.js
@@ -24,13 +24,22 @@
                        'Scrolling has been bound and is handler is called on 
scroll' );
        } );
 
-       QUnit.skip( 'emits load event', 1, function ( assert ) {
-               var is = new InfiniteScroll();
-               is.setElement( $( 'body' ) );
+       QUnit.test( 'emits load event', 1, function ( assert ) {
+               var asyncDone = assert.async(),
+                       is = new InfiniteScroll();
 
+               // Make sure we always have somewhere to scroll
+               $( 'body' ).height( '9999px' );
+
+               is.setElement( $( 'body' ) );
                is.on( 'load', function () {
                        assert.ok( true, 'Load event emitted' );
-                       QUnit.start();
+
+                       // Reset height
+                       $( 'body' ).css( 'height', '' );
+
+                       // Finish
+                       asyncDone();
                } );
 
                // Scroll to the bottom of the body
diff --git a/tests/qunit/mobile.settings/test_settings.js 
b/tests/qunit/mobile.settings/test_settings.js
index 3d63c79..58a0aa7 100644
--- a/tests/qunit/mobile.settings/test_settings.js
+++ b/tests/qunit/mobile.settings/test_settings.js
@@ -38,7 +38,7 @@
                }
        } );
 
-       QUnit.skip( 'check cookies', 2, function ( assert ) {
+       QUnit.test( 'check cookies', 2, function ( assert ) {
                assert.strictEqual(
                        settings.cookiesEnabled(),
                        true,
@@ -54,7 +54,7 @@
                );
        } );
 
-       QUnit.skip( 'localstorage', 3, function ( assert ) {
+       QUnit.test( 'localstorage', 3, function ( assert ) {
                assert.strictEqual(
                        settings.get( 'test_key' ),
                        null,
@@ -76,7 +76,7 @@
                );
        } );
 
-       QUnit.skip( 'cookie fallback', 3, function ( assert ) {
+       QUnit.test( 'cookie fallback', 3, function ( assert ) {
                assert.strictEqual(
                        settings.get( 'test_key', true ),
                        null,
@@ -102,13 +102,12 @@
                setup: function () {
                        var localStorageCache = {};
 
-                       this.sandbox.stub( mw.storage, 
'isLocalStorageSupported', true );
-                       this.sandbox.stub( localStorage, 'setItem' ).throws();
-                       this.sandbox.stub( localStorage, 'getItem', function ( 
key ) {
+                       this.sandbox.stub( mw.storage, 'set' ).returns( false );
+                       this.sandbox.stub( mw.storage, 'get', function ( key ) {
                                // localStorage returns null for missing items
                                return localStorageCache[key] || null;
                        } );
-                       this.sandbox.stub( localStorage, 'removeItem', function 
( key ) {
+                       this.sandbox.stub( mw.storage, 'remove', function ( key 
) {
                                delete localStorageCache[key];
                        } );
 
@@ -117,7 +116,7 @@
                        this.sandbox.restore();
                }
        } );
-       QUnit.skip( 'without cookies or localStorage', 3, function ( assert ) {
+       QUnit.test( 'without cookies or mw.storage', 3, function ( assert ) {
                assert.strictEqual(
                        settings.save( 'test_key', 'yep' ),
                        false,
@@ -133,7 +132,7 @@
                assert.strictEqual(
                        settings.get( 'test_key' ),
                        null,
-                       'test_key has been correctly removed (even if it 
didn\'t exist in the first place'
+                       'test_key has been correctly removed (even if it 
didn\'t exist in the first place)'
                );
        } );
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I729d0a4af9346654269c8855a4102d3fc02484c3
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Sn1per <geof...@gmail.com>
Gerrit-Reviewer: Bmansurov <bmansu...@wikimedia.org>
Gerrit-Reviewer: Jdlrobson <jrob...@wikimedia.org>
Gerrit-Reviewer: Sn1per <geof...@gmail.com>
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