diff --git a/addons/web_editor/static/src/js/wysiwyg_snippets/wysiwyg_snippets.js b/addons/web_editor/static/src/js/wysiwyg_snippets/wysiwyg_snippets.js index d1dc29ca7b1..0f411343486 100644 --- a/addons/web_editor/static/src/js/wysiwyg_snippets/wysiwyg_snippets.js +++ b/addons/web_editor/static/src/js/wysiwyg_snippets/wysiwyg_snippets.js @@ -150,6 +150,7 @@ Wysiwyg.include({ if (this.snippets) { this.snippets.updateCurrentSnippetEditorOverlay(); } + this._summernote.invoke('toolbar.update', true); this._super.apply(this, arguments); }, /** diff --git a/addons/web_editor/static/tests/wysiwyg_snippets_tests.js b/addons/web_editor/static/tests/wysiwyg_snippets_tests.js index 2441897b36d..5f249feb30a 100644 --- a/addons/web_editor/static/tests/wysiwyg_snippets_tests.js +++ b/addons/web_editor/static/tests/wysiwyg_snippets_tests.js @@ -175,7 +175,7 @@ QUnit.test('clean the dom before save', function (assert) { QUnit.test('remove snippet', function (assert) { var done = assert.async(); - assert.expect(1); + assert.expect(2); return weTestUtils.createWysiwyg({ wysiwygOptions: { @@ -186,7 +186,9 @@ QUnit.test('remove snippet', function (assert) { var $editable = wysiwyg.getEditable(); testUtils.mock.intercept(wysiwyg, "snippet_focused", function () { + $('.note-btn-bold').removeClass('o_disabled'); $('#oe_manipulators .oe_overlay_options .oe_snippet_remove').click(); + assert.ok($('.note-btn-bold').hasClass('o_disabled')); wysiwyg.save().then(function (isDirty, html) { assert.strictEqual(html.replace(/\s+/g, ' '), '', "should remove the snippet");