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

Change subject: Hygiene: Make WatchListApi tests synchronous
......................................................................


Hygiene: Make WatchListApi tests synchronous

The WatchListApi#get method is stubbed to return a promise that is
already resolved so there's no need to use QUnit's asynchronous testing
feature.

Bug: T98377
Change-Id: If35b15e215f7ce262dc64af70a83360ad269daf5
---
M tests/qunit/mobile.watchlist/test_WatchListApi.js
1 file changed, 2 insertions(+), 4 deletions(-)

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



diff --git a/tests/qunit/mobile.watchlist/test_WatchListApi.js 
b/tests/qunit/mobile.watchlist/test_WatchListApi.js
index d5c5b21..a2828aa 100644
--- a/tests/qunit/mobile.watchlist/test_WatchListApi.js
+++ b/tests/qunit/mobile.watchlist/test_WatchListApi.js
@@ -84,7 +84,7 @@
 
        // this.sandbox.stub( WatchListApi.prototype, 'get' ).returns( 
$.Deferred().resolve() );
 
-       QUnit.asyncTest( 'load results from the first page', 2, function ( 
assert ) {
+       QUnit.test( 'load results from the first page', 2, function ( assert ) {
                this.sandbox.stub( WatchListApi.prototype, 'get' )
                        .returns( $.Deferred().resolve( response ) );
 
@@ -93,11 +93,10 @@
                api.load().done( function ( pages ) {
                        assert.equal( pages.length, 6, 'Got all the results' );
                        assert.equal( pages[0].title, 'Albert Einstein', 
'Sorted alphabetically' );
-                       QUnit.start();
                } );
        } );
 
-       QUnit.asyncTest( 'load results from the second page from last item of 
first', 4, function ( assert ) {
+       QUnit.test( 'load results from the second page from last item of 
first', 4, function ( assert ) {
                var lastTitle = 'Albert Einstein',
                        api = new WatchListApi( lastTitle ),
                        response1 = $.extend( {}, response, {
@@ -126,7 +125,6 @@
                                // Albert Einstein should be the first result 
of the next page (not removed)
                                assert.equal( pages.length, 6, 'Albert should 
be in the results' );
                                assert.equal( pages[0].title, 'Albert 
Einstein', 'First item should be Albert' );
-                               QUnit.start();
                        } );
                } );
        } );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: If35b15e215f7ce262dc64af70a83360ad269daf5
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Phuedx <[email protected]>
Gerrit-Reviewer: Jdlrobson <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to