summaryrefslogtreecommitdiff
path: root/addons/web/static
diff options
context:
space:
mode:
authorXavier Morel <xmo@odoo.com>2019-01-23 15:04:49 +0000
committerAaron Bohy <aab@odoo.com>2019-02-18 09:46:49 +0000
commit8b5399c476cd3df48bcc7d19156aa898da4a4306 (patch)
tree22162f1dd131eccae6084407a48ea9f38f19d98a /addons/web/static
parent005164d237d07f2ad8fe3528b9d4eb64a2a21efb (diff)
[FIX] web: properly destroy services in test mock
closes odoo/odoo#30793
Diffstat (limited to 'addons/web/static')
-rw-r--r--addons/web/static/tests/helpers/test_utils_mock.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/addons/web/static/tests/helpers/test_utils_mock.js b/addons/web/static/tests/helpers/test_utils_mock.js
index 3eaaae0a46f..ad7878001f3 100644
--- a/addons/web/static/tests/helpers/test_utils_mock.js
+++ b/addons/web/static/tests/helpers/test_utils_mock.js
@@ -198,6 +198,11 @@ function addMockEnvironment(widget, params) {
// widget is destroyed, at the end of each test to avoid collisions
core.bus.trigger('clear_cache');
+ _(services).chain()
+ .compact() // services can be defined but null (e.g. ajax)
+ .reject(function (s) { return s.isDestroyed(); })
+ .invoke('destroy');
+
DebouncedField.prototype.DEBOUNCE = initialDebounceValue;
dom.DEBOUNCE = initialDOMDebounceValue;
if (params.debounce === false) {