Fix indentaition in *.js files (auto-fix by ESLint)

[MAILPOET-1829]
This commit is contained in:
Jan Jakeš
2019-02-20 12:25:33 +01:00
committed by M. Shull
parent a2e89039c6
commit bb658f77ec
67 changed files with 10595 additions and 10595 deletions

View File

@@ -4,81 +4,81 @@ const sinon = global.sinon;
import EditorApplication from 'newsletter_editor/App';
import TextBlock from 'newsletter_editor/blocks/text';
describe('Text', function () {
describe('model', function () {
var model;
var sandbox;
beforeEach(function () {
global.stubChannel(EditorApplication);
global.stubConfig(EditorApplication);
model = new (TextBlock.TextBlockModel)();
sandbox = sinon.sandbox.create();
});
afterEach(function () {
sandbox.restore();
});
it('has a text type', function () {
expect(model.get('type')).to.equal('text');
});
it('has text', function () {
expect(model.get('text')).to.be.a('string');
});
it('uses defaults from config when they are set', function () {
global.stubConfig(EditorApplication, {
blockDefaults: {
text: {
text: 'some custom config text'
}
}
});
model = new (TextBlock.TextBlockModel)();
expect(model.get('text')).to.equal('some custom config text');
});
it('do not update blockDefaults.text when changed', function () {
var stub = sandbox.stub(EditorApplication.getConfig(), 'set');
model.trigger('change');
expect(stub.callCount).to.equal(0);
});
});
describe('block view', function () {
var model;
var view;
describe('Text', function () {
describe('model', function () {
var model;
var sandbox;
beforeEach(function () {
global.stubChannel(EditorApplication);
global.stubConfig(EditorApplication);
model = new (TextBlock.TextBlockModel)();
view = new (TextBlock.TextBlockView)({ model: model });
sandbox = sinon.sandbox.create();
});
it('renders', function () {
expect(view.render).to.not.throw();
expect(view.$('.mailpoet_content')).to.have.length(1);
afterEach(function () {
sandbox.restore();
});
it('has a text type', function () {
expect(model.get('type')).to.equal('text');
});
it('has text', function () {
expect(model.get('text')).to.be.a('string');
});
it('uses defaults from config when they are set', function () {
global.stubConfig(EditorApplication, {
blockDefaults: {
text: {
text: 'some custom config text'
}
}
});
model = new (TextBlock.TextBlockModel)();
expect(model.get('text')).to.equal('some custom config text');
});
it('do not update blockDefaults.text when changed', function () {
var stub = sandbox.stub(EditorApplication.getConfig(), 'set');
model.trigger('change');
expect(stub.callCount).to.equal(0);
});
});
describe('block view', function () {
var model;
var view;
global.stubConfig(EditorApplication);
model = new (TextBlock.TextBlockModel)();
view = new (TextBlock.TextBlockView)({ model: model });
it('renders', function () {
expect(view.render).to.not.throw();
expect(view.$('.mailpoet_content')).to.have.length(1);
});
describe('once rendered', function () {
model = new (TextBlock.TextBlockModel)();
beforeEach(function () {
global.stubConfig(EditorApplication);
view = new (TextBlock.TextBlockView)({ model: model });
view.render();
});
describe('once rendered', function () {
model = new (TextBlock.TextBlockModel)();
it('has a deletion tool', function () {
expect(view.$('.mailpoet_delete_block')).to.have.length(1);
});
beforeEach(function () {
global.stubConfig(EditorApplication);
view = new (TextBlock.TextBlockView)({ model: model });
view.render();
});
it('has a move tool', function () {
expect(view.$('.mailpoet_move_block')).to.have.length(1);
});
it('has a deletion tool', function () {
expect(view.$('.mailpoet_delete_block')).to.have.length(1);
});
it('has a move tool', function () {
expect(view.$('.mailpoet_move_block')).to.have.length(1);
});
it('does not have a settings tool', function () {
expect(view.$('.mailpoet_edit_block')).to.have.length(0);
});
it('does not have a settings tool', function () {
expect(view.$('.mailpoet_edit_block')).to.have.length(0);
});
});
});
});