From a8e4e625f4075892cd5b86b3dbc61b70ace3470d Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Thu, 2 Aug 2018 13:36:30 +0200 Subject: [IMP] web: remove useless service name We use the registry keys as name for the services. --- addons/mail/static/tests/thread_window_tests.js | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'addons/mail/static/tests/thread_window_tests.js') diff --git a/addons/mail/static/tests/thread_window_tests.js b/addons/mail/static/tests/thread_window_tests.js index 724d24f901e..620aae407f6 100644 --- a/addons/mail/static/tests/thread_window_tests.js +++ b/addons/mail/static/tests/thread_window_tests.js @@ -28,30 +28,26 @@ QUnit.module('mail', { }, }; this.services = mailTestUtils.getMailServices(); - - // backup original thread window append to selector - this.MailService = _.find(this.services, function (Service) { - return Service.prototype.name === 'mail_service'; - }); - this.ORIGINAL_THREAD_WINDOW_APPENDTO = this.MailService.prototype.THREAD_WINDOW_APPENDTO; + this.ORIGINAL_THREAD_WINDOW_APPENDTO = this.services.mail_service.prototype.THREAD_WINDOW_APPENDTO; this.createParent = function (params) { var widget = new Widget(); // in non-debug mode, append thread windows in qunit-fixture if (params.debug) { - self.MailService.prototype.THREAD_WINDOW_APPENDTO = 'body'; + self.services.mail_service.prototype.THREAD_WINDOW_APPENDTO = 'body'; } else { - self.MailService.prototype.THREAD_WINDOW_APPENDTO = '#qunit-fixture'; + self.services.mail_service.prototype.THREAD_WINDOW_APPENDTO = '#qunit-fixture'; } + params.services = _.clone(params.services); testUtils.addMockEnvironment(widget, params); return widget; }; }, afterEach: function () { // reset thread window append to body - this.MailService.prototype.THREAD_WINDOW_APPENDTO = 'body'; + this.services.mail_service.prototype.THREAD_WINDOW_APPENDTO = 'body'; }, }, function () { -- cgit v1.2.3