From c8566507b4f047a40d1baed4e4976c92c1c9db1f Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Sun, 24 Apr 2016 15:53:51 +0200 Subject: [PATCH] Add Commands test --- src/commands/main.js | 4 +++- test/runner/main.js | 1 + test/specs/commands/main.js | 30 ++++++++++++++++++++++++++++++ 3 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 test/specs/commands/main.js diff --git a/src/commands/main.js b/src/commands/main.js index 23edf9846..fdab3869d 100644 --- a/src/commands/main.js +++ b/src/commands/main.js @@ -88,7 +88,9 @@ define(function(require) { defaultCommands['open-layers'] = require('./view/OpenLayers'); defaultCommands['open-sm'] = require('./view/OpenStyleManager'); //this.defaultCommands['resize-comp'] = require('./view/ResizeComponent'); - config.model = config.em.get('Canvas'); + + if(config.em) + config.model = config.em.get('Canvas'); return { diff --git a/test/runner/main.js b/test/runner/main.js index e455cd5ed..b0a04b652 100644 --- a/test/runner/main.js +++ b/test/runner/main.js @@ -16,6 +16,7 @@ require(['../src/config/require-config.js', 'config/config.js'], function() { 'specs/css_composer/main.js', 'specs/code_manager/main.js', 'specs/panels/main.js', + 'specs/commands/main.js', ], function(chai) { var should = chai.should(), diff --git a/test/specs/commands/main.js b/test/specs/commands/main.js new file mode 100644 index 000000000..eb70b28dd --- /dev/null +++ b/test/specs/commands/main.js @@ -0,0 +1,30 @@ +var modulePath = './../../../test/specs/commands'; + +define([ + 'Commands'], + function( + Commands + ) { + + describe('Commands', function() { + + describe('Main', function() { + + var obj; + + beforeEach(function () { + obj = new Commands(); + }); + + afterEach(function () { + delete obj; + }); + + it('Object exists', function() { + obj.should.be.exist; + }); + + }); + + }); +}); \ No newline at end of file