|
|
@ -1,5 +1,5 @@ |
|
|
define(['GrapesJS', 'PluginManager'], |
|
|
define(['GrapesJS', 'PluginManager', 'chai'], |
|
|
function(GrapesJS, PluginManager) { |
|
|
function(GrapesJS, PluginManager, chai) { |
|
|
|
|
|
|
|
|
describe('GrapesJS', function() { |
|
|
describe('GrapesJS', function() { |
|
|
|
|
|
|
|
|
@ -40,7 +40,7 @@ define(['GrapesJS', 'PluginManager'], |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
it('Init new editor', function() { |
|
|
it('Init new editor', function() { |
|
|
var editor = obj.init(); |
|
|
var editor = obj.init(config); |
|
|
editor.should.not.be.empty; |
|
|
editor.should.not.be.empty; |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
@ -65,16 +65,17 @@ define(['GrapesJS', 'PluginManager'], |
|
|
it('Init editor with css', function() { |
|
|
it('Init editor with css', function() { |
|
|
config.style = cssString; |
|
|
config.style = cssString; |
|
|
var editor = obj.init(config); |
|
|
var editor = obj.init(config); |
|
|
console.log(editor.CssComposer.getRules()); |
|
|
|
|
|
var rules = editor.CssComposer.getRules(); |
|
|
var rules = editor.CssComposer.getRules(); |
|
|
rules.length.should.equal(2); |
|
|
rules.length.should.equal(2); |
|
|
rules.at(0).get('selectors').at(0).get('name').should.equal('test2'); |
|
|
rules.at(0).get('selectors').at(0).get('name').should.equal('test2'); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
it('Init editor from element', function() { |
|
|
it.skip('Init editor from element', function() { |
|
|
config.fromElement = 1; |
|
|
config.fromElement = 1; |
|
|
fixture.html(documentEl); |
|
|
fixture.html(documentEl); |
|
|
|
|
|
console.log('START'); |
|
|
var editor = obj.init(config); |
|
|
var editor = obj.init(config); |
|
|
|
|
|
console.log('END'); |
|
|
var html = editor.getHtml(); |
|
|
var html = editor.getHtml(); |
|
|
var css = editor.getCss(); |
|
|
var css = editor.getCss(); |
|
|
(html ? html : '').should.equal(htmlString); |
|
|
(html ? html : '').should.equal(htmlString); |
|
|
|