diff --git a/addons/web/static/src/core/tooltip/tooltip.xml b/addons/web/static/src/core/tooltip/tooltip.xml
index bff6a9f28c7..8eb108ae901 100644
--- a/addons/web/static/src/core/tooltip/tooltip.xml
+++ b/addons/web/static/src/core/tooltip/tooltip.xml
@@ -3,7 +3,7 @@
-
+
diff --git a/addons/web/static/tests/core/tooltip/tooltip_service_tests.js b/addons/web/static/tests/core/tooltip/tooltip_service_tests.js
index 193faced077..5c1c5a9f4b2 100644
--- a/addons/web/static/tests/core/tooltip/tooltip_service_tests.js
+++ b/addons/web/static/tests/core/tooltip/tooltip_service_tests.js
@@ -26,6 +26,7 @@ const mainComponents = registry.category("main_components");
* @param {function} [options.mockClearTimeout] the mocked clearTimeout to use (by default, does nothing)
* @param {function} [options.mockClearInterval] the mocked clearInterval to use (by default, does nothing)
* @param {function} [options.onPopoverAdded] use this callback to check what is being passed to the popover service
+ * @param {Object} [options.extraEnv] an object whose keys should be added to the env
* @param {{[templateName:string]: string}} [options.templates] additional templates
* @returns {Promise}
*/
@@ -47,7 +48,10 @@ export async function makeParent(Child, options = {}) {
registry.category("services").add("popover", popoverService);
registry.category("services").add("tooltip", tooltipService);
registry.category("services").add("localization", makeFakeLocalizationService());
- const env = await makeTestEnv();
+ let env = await makeTestEnv();
+ if (options.extraEnv) {
+ env = Object.create(env, Object.getOwnPropertyDescriptors(options.extraEnv));
+ }
patchWithCleanup(env.services.popover, {
add(...args) {
@@ -300,9 +304,9 @@ QUnit.module("Tooltip service", (hooks) => {
`;
const templates = {
- my_tooltip_template: "tooltip",
+ my_tooltip_template: "",
};
- await makeParent(MyComponent, { templates });
+ await makeParent(MyComponent, { templates, extraEnv: { tooltip_text: "tooltip" } });
assert.containsNone(target, ".o_popover_container .o-tooltip");
target.querySelector("button").dispatchEvent(new Event("mouseenter"));