editor: Disable update blockDefaults for texts and images
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
const expect = global.expect;
|
||||
const sinon = global.sinon;
|
||||
|
||||
define([
|
||||
'newsletter_editor/App',
|
||||
@ -7,10 +8,16 @@ define([
|
||||
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 () {
|
||||
@ -33,6 +40,12 @@ define([
|
||||
|
||||
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 () {
|
||||
|
Reference in New Issue
Block a user