forked from GrapesJS/grapesjs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update tests for commands and css composer
- Loading branch information
Showing
16 changed files
with
689 additions
and
708 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
var Commands = require('commands'); | ||
var Models = require('./model/CommandModels'); | ||
|
||
describe('Commands', () => { | ||
|
||
describe('Main', () => { | ||
|
||
let obj; | ||
|
||
beforeEach(() => { | ||
obj = new Commands().init(); | ||
}); | ||
|
||
afterEach(() => { | ||
obj = null; | ||
}); | ||
|
||
it('No commands inside', () => { | ||
expect(obj.get('test')).toEqual(null); | ||
}); | ||
|
||
it('Push new command', () => { | ||
var comm = { test: 'test'}; | ||
obj.add('test', comm); | ||
expect(obj.get('test').test).toEqual('test'); | ||
}); | ||
|
||
it('No default commands at init', () => { | ||
expect(obj.get('select-comp')).toEqual(null); | ||
}); | ||
|
||
it('Default commands after loadDefaultCommands', () => { | ||
obj.loadDefaultCommands(); | ||
expect(obj.get('select-comp')).toNotEqual(null); | ||
}); | ||
|
||
}); | ||
|
||
}); | ||
|
||
Models.run(); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,41 @@ | ||
define(function(require, exports, module){ | ||
'use strict'; | ||
var Commands = require('undefined'); | ||
const Command = require('commands/model/Command'); | ||
const Commands = require('commands'); | ||
|
||
module.exports = { | ||
run : function(){ | ||
describe('Command', function() { | ||
var obj; | ||
module.exports = { | ||
run() { | ||
describe('Command', () => { | ||
let obj; | ||
|
||
beforeEach(function () { | ||
obj = new Command(); | ||
}); | ||
beforeEach(() => { | ||
obj = new Command(); | ||
}); | ||
|
||
afterEach(function () { | ||
delete obj; | ||
}); | ||
afterEach(() => { | ||
obj = null; | ||
}); | ||
|
||
it('Has id property', function() { | ||
obj.has('id').should.equal(true); | ||
}); | ||
it('Has id property', () => { | ||
expect(obj.has('id')).toEqual(true); | ||
}); | ||
|
||
}); | ||
}); | ||
|
||
describe('Commands', function() { | ||
var obj; | ||
describe('Commands', () => { | ||
var obj; | ||
|
||
beforeEach(function () { | ||
obj = new Commands(); | ||
}); | ||
beforeEach(() => { | ||
obj = new Commands(); | ||
}); | ||
|
||
afterEach(function () { | ||
delete obj; | ||
}); | ||
afterEach(() => { | ||
obj = null; | ||
}); | ||
|
||
it('Object is ok', function() { | ||
obj.should.be.ok; | ||
}); | ||
it('Object is ok', () => { | ||
expect(obj).toExist(); | ||
}); | ||
|
||
}); | ||
}); | ||
|
||
} | ||
}; | ||
|
||
}); | ||
} | ||
}; |
Oops, something went wrong.