Tests vars-on-top

This commit is contained in:
Amine Ben hammou
2017-09-27 15:10:51 +00:00
parent 4e2e9f6f8f
commit 9b41641e97
17 changed files with 88 additions and 51 deletions

View File

@ -13,8 +13,9 @@ define([
describe('model', function () {
describe('by default', function () {
var model;
global.stubConfig(EditorApplication);
var model = new ModelClass();
model = new ModelClass();
it('has container type', function () {
expect(model.get('type')).to.equal('container');
@ -33,6 +34,7 @@ define([
});
it('uses defaults from config when they are set', function () {
var model;
global.stubConfig(EditorApplication, {
blockDefaults: {
container: {
@ -44,7 +46,7 @@ define([
}
}
});
var model = new (ContainerBlock.ContainerBlockModel)();
model = new (ContainerBlock.ContainerBlockModel)();
expect(model.get('styles.block.backgroundColor')).to.equal('#123456');
});
@ -107,10 +109,12 @@ define([
});
describe('block view', function () {
var model;
var view;
global.stubChannel(EditorApplication);
global.stubAvailableStyles(EditorApplication);
var model = new (ContainerBlock.ContainerBlockModel)();
var view = new (ContainerBlock.ContainerBlockView)({model: model});
model = new (ContainerBlock.ContainerBlockModel)();
view = new (ContainerBlock.ContainerBlockView)({model: model});
it('renders', function () {
expect(view.render).to.not.throw();
@ -187,10 +191,12 @@ define([
});
describe('settings view', function () {
var model;
var view;
global.stubChannel(EditorApplication);
global.stubAvailableStyles(EditorApplication);
var model = new (ContainerBlock.ContainerBlockModel)();
var view = new (ContainerBlock.ContainerBlockSettingsView)({model: model});
model = new (ContainerBlock.ContainerBlockModel)();
view = new (ContainerBlock.ContainerBlockSettingsView)({model: model});
it('renders', function () {
expect(view.render).to.not.throw();