summaryrefslogtreecommitdiff
path: root/addons/web/static/tests/chrome
diff options
context:
space:
mode:
authorAaron Bohy <aab@odoo.com>2020-06-05 09:18:14 +0000
committerAaron Bohy <aab@odoo.com>2020-06-12 09:47:48 +0000
commitb4ba0fc34082deec8ca6c871ce7a203c0a3a61a4 (patch)
tree27451423f32b218e699d3135c398d338b249c5cd /addons/web/static/tests/chrome
parentdc260c324170a90fa737cd21dd528e39d658d9b6 (diff)
[FIX] *: adapt tests to env rework
This commit adapts tests following recent changes on the helpers. The main change is that addMockEnvironment (and all functions using it) are now async, as they need to wait for services to be started.
Diffstat (limited to 'addons/web/static/tests/chrome')
-rw-r--r--addons/web/static/tests/chrome/keyboard_navigation_mixin_tests.js4
-rw-r--r--addons/web/static/tests/chrome/menu_tests.js4
-rw-r--r--addons/web/static/tests/chrome/systray_tests.js3
-rw-r--r--addons/web/static/tests/chrome/user_menu_tests.js2
4 files changed, 6 insertions, 7 deletions
diff --git a/addons/web/static/tests/chrome/keyboard_navigation_mixin_tests.js b/addons/web/static/tests/chrome/keyboard_navigation_mixin_tests.js
index dcf1c23ce39..b0c638dd802 100644
--- a/addons/web/static/tests/chrome/keyboard_navigation_mixin_tests.js
+++ b/addons/web/static/tests/chrome/keyboard_navigation_mixin_tests.js
@@ -26,7 +26,7 @@ QUnit.module('KeyboardNavigationMixin', function () {
return this._super(...arguments);
},
});
- var parent = testUtils.createParent({});
+ var parent = await testUtils.createParent({});
var w = new KeyboardWidget(parent);
await w.appendTo($target);
@@ -67,7 +67,7 @@ QUnit.module('KeyboardNavigationMixin', function () {
return this._super(...arguments);
},
});
- var parent = testUtils.createParent({});
+ var parent = await testUtils.createParent({});
var w = new KeyboardWidget(parent);
await w.appendTo($target);
diff --git a/addons/web/static/tests/chrome/menu_tests.js b/addons/web/static/tests/chrome/menu_tests.js
index c7ce40b16c2..a50e2189906 100644
--- a/addons/web/static/tests/chrome/menu_tests.js
+++ b/addons/web/static/tests/chrome/menu_tests.js
@@ -13,7 +13,7 @@ odoo.define('web.menu_tests', function (require) {
QUnit.test('Systray on_attach_callback is called', async function (assert) {
assert.expect(4);
- const parent = testUtils.createParent({});
+ const parent = await testUtils.createParent({});
// Add some widgets to the systray
const Widget1 = Widget.extend({
@@ -22,7 +22,7 @@ odoo.define('web.menu_tests', function (require) {
const Widget2 = Widget.extend({
on_attach_callback: () => assert.step('on_attach_callback widget2')
});
- SystrayMenu.Items = [Widget1, Widget2]
+ SystrayMenu.Items = [Widget1, Widget2];
testUtils.mock.patch(SystrayMenu, {
on_attach_callback: function () {
diff --git a/addons/web/static/tests/chrome/systray_tests.js b/addons/web/static/tests/chrome/systray_tests.js
index c5238ceff04..941e275f19b 100644
--- a/addons/web/static/tests/chrome/systray_tests.js
+++ b/addons/web/static/tests/chrome/systray_tests.js
@@ -7,8 +7,7 @@ odoo.define('web.systray_tests', function (require) {
QUnit.test('Adding async components to the registry respects the sequence', async function (assert) {
assert.expect(2);
- var parent = testUtils.createParent({
- });
+ var parent = await testUtils.createParent({});
var prom = testUtils.makeTestPromise();
var synchronousFirstWidget = Widget.extend({
diff --git a/addons/web/static/tests/chrome/user_menu_tests.js b/addons/web/static/tests/chrome/user_menu_tests.js
index 73c74b0753c..752697a5228 100644
--- a/addons/web/static/tests/chrome/user_menu_tests.js
+++ b/addons/web/static/tests/chrome/user_menu_tests.js
@@ -13,7 +13,7 @@ QUnit.module('chrome', {}, function () {
var parent = new Widget();
- testUtils.mock.addMockEnvironment(parent, {});
+ await testUtils.mock.addMockEnvironment(parent, {});
var userMenu = new UserMenu(parent);
await userMenu.appendTo($('body'));