From 19fdcc86f343323282e876317cc760cad34ed063 Mon Sep 17 00:00:00 2001 From: Matthias Mullie Date: Wed, 17 May 2017 11:53:25 +0200 Subject: [PATCH] Fix mmv.model.TaskQueue qunit tests Bug: T164473 Change-Id: Iaefae1d00a0469f11ddb3fcecb4f831346ac0eec --- tests/qunit/mmv/model/mmv.model.TaskQueue.test.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/qunit/mmv/model/mmv.model.TaskQueue.test.js b/tests/qunit/mmv/model/mmv.model.TaskQueue.test.js index 7284f0034..bfbb67d3e 100644 --- a/tests/qunit/mmv/model/mmv.model.TaskQueue.test.js +++ b/tests/qunit/mmv/model/mmv.model.TaskQueue.test.js @@ -36,14 +36,15 @@ QUnit.test( 'State check', 3, function ( assert ) { var taskQueue = new mw.mmv.model.TaskQueue(), - task = $.Deferred(); + task = $.Deferred(), + promise; taskQueue.push( function () { return task; } ); assert.strictEqual( taskQueue.state, mw.mmv.model.TaskQueue.State.NOT_STARTED, 'state is initially NOT_STARTED' ); - taskQueue.execute().then( function () { + promise = taskQueue.execute().then( function () { assert.strictEqual( taskQueue.state, mw.mmv.model.TaskQueue.State.FINISHED, 'state is FINISHED after execution finished' ); } ); @@ -51,7 +52,9 @@ assert.strictEqual( taskQueue.state, mw.mmv.model.TaskQueue.State.RUNNING, 'state is RUNNING after execution started' ); - return task.resolve(); + task.resolve(); + + return promise; } ); QUnit.test( 'State check for cancellation', 1, function ( assert ) {