[FIX] web: properly destroy services in test mock

closes odoo/odoo#30793
This commit is contained in:
Xavier Morel
2019-02-18 09:46:49 +00:00
committed by Aaron Bohy
parent 005164d237
commit 8b5399c476
@@ -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) {