From aebbd0317f20c95d2fae9599bf56c840a2d30322 Mon Sep 17 00:00:00 2001 From: Romain Derie Date: Thu, 6 Jun 2019 11:13:43 +0200 Subject: [PATCH] [FIX] mail, web: directly load async debug.xml during QUnit tests Before this commit, the test `list: edit view menu item` would sometimes crash as now the debug manager loads its templates with an `xmlDependencies` where it was not the case before (included in base.xml), see 73327db0656bf. --- addons/mail/static/tests/tools/debug_manager_tests.js | 2 +- addons/web/static/tests/helpers/test_utils.js | 1 + addons/web/static/tests/tools/debug_manager_tests.js | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/mail/static/tests/tools/debug_manager_tests.js b/addons/mail/static/tests/tools/debug_manager_tests.js index 7671150f0d8..c21d36572b9 100644 --- a/addons/mail/static/tests/tools/debug_manager_tests.js +++ b/addons/mail/static/tests/tools/debug_manager_tests.js @@ -28,7 +28,7 @@ QUnit.module('Mail DebugManager', {}, function () { }, }); - debugManager.appendTo($('#qunit-fixture')); + await debugManager.appendTo($('#qunit-fixture')); // Simulate update debug manager from web client var action = { diff --git a/addons/web/static/tests/helpers/test_utils.js b/addons/web/static/tests/helpers/test_utils.js index ccf5d8daf6b..460bd9f4f78 100644 --- a/addons/web/static/tests/helpers/test_utils.js +++ b/addons/web/static/tests/helpers/test_utils.js @@ -102,6 +102,7 @@ async function nextTick() { // to load xml files that are normally lazy loaded by specific widgets). return Promise.all([ session.is_bound, + ajax.loadXML('/web/static/src/xml/debug.xml', core.qweb), ajax.loadXML('/web/static/src/xml/dialog.xml', core.qweb) ]).then(function () { setTimeout(function () { diff --git a/addons/web/static/tests/tools/debug_manager_tests.js b/addons/web/static/tests/tools/debug_manager_tests.js index 0de3d5857e0..0f850835c66 100644 --- a/addons/web/static/tests/tools/debug_manager_tests.js +++ b/addons/web/static/tests/tools/debug_manager_tests.js @@ -13,7 +13,7 @@ QUnit.module('DebugManager', {}, function () { var debugManager = createDebugManager(); - debugManager.appendTo($('#qunit-fixture')); + await debugManager.appendTo($('#qunit-fixture')); // Simulate update debug manager from web client var action = {