editor: Omit text property from block defaults for header and footer

This commit is contained in:
Rostislav Wolny
2018-03-14 20:15:18 +01:00
parent 1d9b4839f7
commit 3a8b64e11c
4 changed files with 12 additions and 2 deletions

View File

@ -33,6 +33,9 @@ define([
}
}
}, App.getConfig().get('blockDefaults.footer'));
},
_updateDefaults: function updateDefaults() {
App.getConfig().set('blockDefaults.footer', _.omit(this.toJSON(), 'text'));
}
});

View File

@ -33,6 +33,9 @@ define([
}
}
}, App.getConfig().get('blockDefaults.header'));
},
_updateDefaults: function updateDefaults() {
App.getConfig().set('blockDefaults.header', _.omit(this.toJSON(), 'text'));
}
});

View File

@ -125,7 +125,9 @@ define([
model.trigger('change');
expect(stub.callCount).to.equal(1);
expect(stub.getCall(0).args[0]).to.equal('blockDefaults.footer');
expect(stub.getCall(0).args[1]).to.deep.equal(model.toJSON());
expect(stub.getCall(0).args[1].type).to.equal(model.toJSON().type);
expect(stub.getCall(0).args[1].styles).to.deep.equal(model.toJSON().styles);
expect(stub.getCall(0).args[1].text).to.equal(undefined);
});
});

View File

@ -124,7 +124,9 @@ define([
model.trigger('change');
expect(stub.callCount).to.equal(1);
expect(stub.getCall(0).args[0]).to.equal('blockDefaults.header');
expect(stub.getCall(0).args[1]).to.deep.equal(model.toJSON());
expect(stub.getCall(0).args[1].type).to.equal(model.toJSON().type);
expect(stub.getCall(0).args[1].styles).to.deep.equal(model.toJSON().styles);
expect(stub.getCall(0).args[1].text).to.equal(undefined);
});
});