editor: Save button, divider defaults by its context of usage

This commit is contained in:
Rostislav Wolny
2018-03-12 15:22:50 +01:00
parent 8582c19ac0
commit fbfcfcc85b
4 changed files with 22 additions and 1 deletions

View File

@ -118,6 +118,14 @@ define([
expect(stub.getCall(0).args[1]).to.deep.equal(model.toJSON());
});
it('updates blockDefaults for usage context when changed', function () {
var stub = sandbox.stub(EditorApplication.getConfig(), 'set');
model.set('context', 'posts.readMoreButton');
expect(stub.callCount).to.equal(1);
expect(stub.getCall(0).args[0]).to.equal('blockDefaults.posts.readMoreButton');
expect(stub.getCall(0).args[1]).to.deep.equal(model.toJSON());
});
it('uses defaults from config when they are set', function () {
global.stubConfig(EditorApplication, {
blockDefaults: {