summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/tests/field_html_tests.js
diff options
context:
space:
mode:
authorAaron Bohy <aab@odoo.com>2020-06-08 11:50:24 +0000
committerAaron Bohy <aab@odoo.com>2020-07-13 12:55:07 +0000
commitaf85bb5e13b9c97d022a721bd782a37d718e4496 (patch)
tree731c1983542ec3fc07b3b70832659d5ad803252d /addons/web_editor/static/tests/field_html_tests.js
parentce3c7d8714c330b8344ffb76245c364045cbf62f (diff)
[IMP] web,*: do not deploy services in tests
*mail,point_of_sale,web_editor,website In the tests, required services are deployed for each test independently. There is no need to have, in additon, all services deployed globally. Worse, it could conflict and lead to unexpected results. This commit ensures services are no longer deployed globally in tests. It turns the module 'web.env' into a declarative module with no side-effect, by moving the service deployment to main.js, which isn't added to the tests page. Task 2287397 closes odoo/odoo#53817 Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
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();
});