From d8ddc807176a3f41a21fb26718e54f72198acac2 Mon Sep 17 00:00:00 2001 From: Alexandr Evseev Date: Mon, 6 Oct 2014 11:37:26 +0000 Subject: [PATCH] [Echo.Canvas] one more test case added for updateLayout metho --- tests/unit/canvas.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/unit/canvas.js b/tests/unit/canvas.js index 8949f678..4d42e1a1 100644 --- a/tests/unit/canvas.js +++ b/tests/unit/canvas.js @@ -430,6 +430,20 @@ Echo.Tests.asyncTest("updateLayout method", function() { QUnit.equal(SampleApp.apps["third"].initialized, 1, "third app hasn't been re-initialized."); callback(); }); + }, + function(callback) { + // app list is empty, all the apps should be destroyed + canvas.updateLayout([], layout).then(function() { + QUnit.equal(SampleApp.apps["first"].destroyed, 1, "first app has been destroyed"); + QUnit.equal(SampleApp.apps["first"].initialized, 1, "first app hasn't been re-initialized."); + + QUnit.equal(SampleApp.apps["second"].destroyed, 2, "second app has been destroyed"); + QUnit.equal(SampleApp.apps["second"].initialized, 2, "second app hasn't been re-initialized."); + + QUnit.equal(SampleApp.apps["third"].initialized, 1, "third app hasn't been re-initialized."); + callback(); + + }); } ], function() { QUnit.start();