From 2de4d415d24c06d64ec355d57416343a1cb597a1 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Tue, 12 Mar 2019 23:14:42 +0100 Subject: [PATCH] Fix tests --- src/editor/model/Editor.js | 2 +- test/specs/commands/view/CommandAbstract.js | 17 ++++++++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/editor/model/Editor.js b/src/editor/model/Editor.js index 2d7d26323..a98d59b04 100644 --- a/src/editor/model/Editor.js +++ b/src/editor/model/Editor.js @@ -15,8 +15,8 @@ const deps = [ require('storage_manager'), require('device_manager'), require('parser'), - require('style_manager'), require('selector_manager'), + require('style_manager'), require('modal_dialog'), require('code_manager'), require('panels'), diff --git a/test/specs/commands/view/CommandAbstract.js b/test/specs/commands/view/CommandAbstract.js index 5692184a1..c8ab6d88a 100644 --- a/test/specs/commands/view/CommandAbstract.js +++ b/test/specs/commands/view/CommandAbstract.js @@ -24,8 +24,7 @@ module.exports = { const runStub = sinon.stub(command, 'run').returns('result'); const result = command.callRun(editor); - - expect(editorTriggerSpy.calledTwice).toEqual(true); + expect(editorTriggerSpy.callCount).toEqual(3); expect(editorTriggerSpy.getCall(0).args).toEqual([ 'run:test:before', {} @@ -35,6 +34,12 @@ module.exports = { 'result', {} ]); + expect(editorTriggerSpy.getCall(2).args).toEqual([ + 'run', + 'test', + 'result', + {} + ]); expect(result).toEqual('result'); expect(runStub.calledOnce).toEqual(true); @@ -64,7 +69,7 @@ module.exports = { const result = command.callStop(editor); - expect(editorTriggerSpy.calledTwice).toEqual(true); + expect(editorTriggerSpy.callCount).toEqual(3); expect(editorTriggerSpy.getCall(0).args).toEqual([ 'stop:test:before', {} @@ -74,6 +79,12 @@ module.exports = { 'stopped', {} ]); + expect(editorTriggerSpy.getCall(2).args).toEqual([ + 'stop', + 'test', + 'stopped', + {} + ]); expect(result).toEqual('stopped'); expect(stopStub.calledOnce).toEqual(true);