summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/tests/field_html_tests.js
diff options
context:
space:
mode:
Diffstat (limited to 'addons/web_editor/static/tests/field_html_tests.js')
-rw-r--r--addons/web_editor/static/tests/field_html_tests.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/addons/web_editor/static/tests/field_html_tests.js b/addons/web_editor/static/tests/field_html_tests.js
index 52f55653c72..21c54266fae 100644
--- a/addons/web_editor/static/tests/field_html_tests.js
+++ b/addons/web_editor/static/tests/field_html_tests.js
@@ -176,6 +176,13 @@ QUnit.module('web_editor', {}, function () {
'</form>',
res_id: 1,
});
+
+ // Summernote needs a RootWidget to set as parent of the ColorPaletteWidget. In the
+ // tests, there is no RootWidget, so we set it here to the parent of the form view, which
+ // can act as RootWidget, as it will honor rpc requests correctly (to the MockServer).
+ const rootWidget = odoo.__DEBUG__.services['root.widget'];
+ odoo.__DEBUG__.services['root.widget'] = form.getParent();
+
await testUtils.form.clickEdit(form);
var $field = form.$('.oe_form_field[name="body"]');
@@ -233,6 +240,7 @@ QUnit.module('web_editor', {}, function () {
'<p>t<font style="background-color: rgb(0, 255, 255);">oto t</font><font style="" class="bg-o-color-3">oto&nbsp;</font><font class="bg-o-color-3" style="">to</font>to</p><p>tata</p>',
"should have rendered the field correctly in edit");
+ odoo.__DEBUG__.services['root.widget'] = rootWidget;
form.destroy();
});