mirror of https://github.com/artf/grapesjs.git
nocodeframeworkdrag-and-dropsite-buildersite-generatortemplate-builderui-builderweb-builderweb-builder-frameworkwebsite-builderno-codepage-builder
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
50 lines
1.1 KiB
50 lines
1.1 KiB
var modulePath = './../../../test/specs/commands';
|
|
|
|
define([
|
|
'Commands',
|
|
modulePath + '/model/CommandModels',
|
|
],
|
|
function(
|
|
Commands,
|
|
Models
|
|
) {
|
|
|
|
describe('Commands', function() {
|
|
|
|
describe('Main', function() {
|
|
|
|
var obj;
|
|
|
|
beforeEach(function () {
|
|
obj = new Commands().init();
|
|
});
|
|
|
|
afterEach(function () {
|
|
delete obj;
|
|
});
|
|
|
|
it('No commands inside', function() {
|
|
(obj.get('test') == null).should.equal(true);
|
|
});
|
|
|
|
it('Push new command', function() {
|
|
var comm = { test: 'test'};
|
|
obj.add('test', comm);
|
|
(obj.get('test').test == 'test').should.equal(true);
|
|
});
|
|
|
|
it('No default commands at init', function() {
|
|
(obj.get('select-comp') == null).should.equal(true);
|
|
});
|
|
|
|
it('Default commands after loadDefaultCommands', function() {
|
|
obj.loadDefaultCommands();
|
|
(obj.get('select-comp') == null).should.equal(false);
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
Models.run();
|
|
});
|