From 86fcf190660bfd0bbd2d965b031c05c09bfe43e6 Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Thu, 14 Jul 2016 16:14:20 -0700 Subject: [PATCH] [Persistence] Update Save As spec ...to account for asynchrony in test case due to usage of Promise.all --- .../commonUI/edit/test/actions/SaveAsActionSpec.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/platform/commonUI/edit/test/actions/SaveAsActionSpec.js b/platform/commonUI/edit/test/actions/SaveAsActionSpec.js index dbdd1f9692..4ad8ffa215 100644 --- a/platform/commonUI/edit/test/actions/SaveAsActionSpec.js +++ b/platform/commonUI/edit/test/actions/SaveAsActionSpec.js @@ -179,9 +179,15 @@ define( }); it("hides the blocking dialog after saving", function () { - action.perform(); + var mockCallback = jasmine.createSpy(); + action.perform().then(mockCallback); expect(mockDialogService.showBlockingMessage).toHaveBeenCalled(); - expect(mockDialogService.dismiss).toHaveBeenCalled(); + waitsFor(function () { + return mockCallback.calls.length > 0; + }); + runs(function () { + expect(mockDialogService.dismiss).toHaveBeenCalled(); + }); }); });