summaryrefslogtreecommitdiff
path: root/addons/web/static/tests/helpers/test_utils_create.js
diff options
context:
space:
mode:
Diffstat (limited to 'addons/web/static/tests/helpers/test_utils_create.js')
-rw-r--r--addons/web/static/tests/helpers/test_utils_create.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/addons/web/static/tests/helpers/test_utils_create.js b/addons/web/static/tests/helpers/test_utils_create.js
index 86fc01b5a4c..908ac97aa62 100644
--- a/addons/web/static/tests/helpers/test_utils_create.js
+++ b/addons/web/static/tests/helpers/test_utils_create.js
@@ -71,10 +71,19 @@ odoo.define('web.test_utils_create', function (require) {
const userContext = params.context && params.context.user_context || {};
const actionManager = new ActionManager(widget, userContext);
+ // Override the ActionMenus registry unless told otherwise.
+ let actionMenusRegistry = ActionMenus.registry;
+ if (params.actionMenusRegistry !== true) {
+ ActionMenus.registry = new Registry();
+ }
+
const originalDestroy = ActionManager.prototype.destroy;
actionManager.destroy = function () {
actionManager.destroy = originalDestroy;
widget.destroy();
+ if (params.actionMenusRegistry !== true) {
+ ActionMenus.registry = actionMenusRegistry;
+ }
};
const fragment = document.createDocumentFragment();
await actionManager.appendTo(fragment);