Keep container block highlighted and tools displayed when editing settings

[MAILPOET-1805]
This commit is contained in:
Rostislav Wolny
2019-02-26 10:24:00 +01:00
committed by M. Shull
parent 6662f4e4d2
commit c9a70c4870
2 changed files with 22 additions and 5 deletions

View File

@ -274,6 +274,18 @@ describe('Container', function () {
expect(model.get('image.src')).to.equal(null);
});
it('displays/hides tools and highlight container block when settings active/inactive', function () {
var settingsView;
var blockView = new (ContainerBlock.ContainerBlockView)({ model: model });
blockView.render();
expect(blockView.$el.hasClass('mailpoet_highlight')).to.equal(false);
settingsView = new (ContainerBlock.ContainerBlockSettingsView)({ model: model });
settingsView.render();
expect(blockView.$el.hasClass('mailpoet_highlight')).to.equal(true);
settingsView.destroy();
expect(blockView.$el.hasClass('mailpoet_highlight')).to.equal(false);
});
it.skip('closes the sidepanel after "Done" is clicked', function () {
var mock = sinon.mock().once();
global.MailPoet.Modal.cancel = mock;