From ae5d22fa0766360a43752d6d25dd0c4260dac34f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20K=C3=BChn?= Date: Wed, 5 Dec 2018 14:34:41 +0000 Subject: [PATCH] [FIX] bus,mail:tests: do not use deprecated test helpers `testUtils.addMockEnvironment` is deprecated since https://github.com/odoo/odoo/commit/abf32b8b21394491040e5c11c1fea809c1d7c62c We should use `testUtils.mock.addMockEnvironment` instead. --- addons/bus/static/tests/bus_tests.js | 4 ++-- .../static/tests/systray/systray_messaging_menu_tests.js | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/addons/bus/static/tests/bus_tests.js b/addons/bus/static/tests/bus_tests.js index c8c7eab2bd9..e58fd22e8a8 100644 --- a/addons/bus/static/tests/bus_tests.js +++ b/addons/bus/static/tests/bus_tests.js @@ -223,7 +223,7 @@ QUnit.module('Bus', { var pollDeferredMaster = $.Deferred(); var parentMaster = new Widget(); - testUtils.addMockEnvironment(parentMaster, { + testUtils.mock.addMockEnvironment(parentMaster, { data: {}, services: { bus_service: BusService, @@ -255,7 +255,7 @@ QUnit.module('Bus', { setTimeout(function () { var parentSlave = new Widget(); var pollDeferredSlave = $.Deferred(); - testUtils.addMockEnvironment(parentSlave, { + testUtils.mock.addMockEnvironment(parentSlave, { data: {}, services: { bus_service: BusService, diff --git a/addons/mail/static/tests/systray/systray_messaging_menu_tests.js b/addons/mail/static/tests/systray/systray_messaging_menu_tests.js index 44651a70523..230da3b0a23 100644 --- a/addons/mail/static/tests/systray/systray_messaging_menu_tests.js +++ b/addons/mail/static/tests/systray/systray_messaging_menu_tests.js @@ -592,7 +592,7 @@ QUnit.test("messaging menu widget: channel seen notification", function ( assert this.data.initMessaging.channel_slots.channel_channel[0].message_unread_counter = 1; var messagingMenu = new MessagingMenu(); - testUtils.addMockEnvironment(messagingMenu, { + testUtils.mock.addMockEnvironment(messagingMenu, { services: this.services, data: this.data, }); @@ -633,7 +633,7 @@ QUnit.test("messaging menu widget: preview with no message should be undated", f this.data['mail.message'].records[0].channel_ids = []; var messagingMenu = new MessagingMenu(); - testUtils.addMockEnvironment(messagingMenu, { + testUtils.mock.addMockEnvironment(messagingMenu, { services: this.services, data: this.data, }); @@ -664,7 +664,7 @@ QUnit.test("messaging menu widget: sort dated previews before undated previews", this.data.initMessaging.channel_slots.direct_message = [dm]; var messagingMenu = new MessagingMenu(); - testUtils.addMockEnvironment(messagingMenu, { + testUtils.mock.addMockEnvironment(messagingMenu, { services: this.services, data: this.data, }); @@ -752,7 +752,7 @@ QUnit.test('global counter with channel previews', function (assert) { this.data['mail.message'].records = messages; var messagingMenu = new MessagingMenu(); - testUtils.addMockEnvironment(messagingMenu, { + testUtils.mock.addMockEnvironment(messagingMenu, { services: this.services, data: this.data, session: {