summaryrefslogtreecommitdiff
path: root/addons/web/static/tests/helpers/test_utils.js
diff options
context:
space:
mode:
authorChristophe Matthieu <chm@odoo.com>2018-08-02 13:36:30 +0200
committerChristophe Matthieu <chm@odoo.com>2018-08-09 02:31:59 +0200
commita8e4e625f4075892cd5b86b3dbc61b70ace3470d (patch)
tree91e065ca47d5c88f6448162cf27ac3c6c70cfba8 /addons/web/static/tests/helpers/test_utils.js
parentcf4c4a11b734d65235e22b27550a499611581fff (diff)
[IMP] web: remove useless service name
We use the registry keys as name for the services.
Diffstat (limited to 'addons/web/static/tests/helpers/test_utils.js')
-rw-r--r--addons/web/static/tests/helpers/test_utils.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/addons/web/static/tests/helpers/test_utils.js b/addons/web/static/tests/helpers/test_utils.js
index a1b2718fc1a..eb558af5deb 100644
--- a/addons/web/static/tests/helpers/test_utils.js
+++ b/addons/web/static/tests/helpers/test_utils.js
@@ -427,15 +427,15 @@ function addMockEnvironment(widget, params) {
// Deploy services
var done = false;
while (!done) {
- var index = _.findIndex(params.services, function (Service) {
+ var serviceName = _.findKey(params.services, function (Service) {
return !_.some(Service.prototype.dependencies, function (depName) {
return !_.has(services, depName);
});
});
- if (index !== -1) {
- var Service = params.services.splice(index, 1)[0];
- services[Service.prototype.name] = new Service(widget);
- services[Service.prototype.name].start();
+ if (serviceName) {
+ var service = services[serviceName] = new params.services[serviceName](widget);
+ delete params.services[serviceName];
+ service.start();
} else {
done = true;
}