diff --git a/addons/im_livechat/__manifest__.py b/addons/im_livechat/__manifest__.py index d4692bb49f2..2cd4c10a2a5 100644 --- a/addons/im_livechat/__manifest__.py +++ b/addons/im_livechat/__manifest__.py @@ -100,8 +100,9 @@ Help your customers with this chat, and analyse their feedback. 'web/static/src/core/browser/feature_detection.js', 'web/static/src/core/dialog/dialog.js', 'web/static/src/core/errors/error_dialogs.js', - 'web/static/src/core/utils/hooks.js', + 'web/static/src/core/effects/**/*.js', 'web/static/src/core/hotkeys/hotkey_service.js', + 'web/static/src/core/hotkeys/hotkey_hook.js', 'web/static/src/core/l10n/dates.js', 'web/static/src/core/l10n/localization.js', 'web/static/src/core/l10n/localization_service.js', @@ -117,8 +118,10 @@ Help your customers with this chat, and analyse their feedback. 'web/static/src/core/user_service.js', 'web/static/src/core/utils/components.js', 'web/static/src/core/utils/functions.js', + 'web/static/src/core/utils/hooks.js', 'web/static/src/core/utils/strings.js', 'web/static/src/core/utils/timing.js', + 'web/static/src/core/utils/ui.js', 'web/static/src/env.js', 'web/static/src/legacy/utils.js', 'web/static/src/legacy/js/owl_compatibility.js', diff --git a/addons/im_livechat/static/src/js/ajax_external.js b/addons/im_livechat/static/src/js/ajax_external.js index 6bcd36952ed..debe12492bc 100644 --- a/addons/im_livechat/static/src/js/ajax_external.js +++ b/addons/im_livechat/static/src/js/ajax_external.js @@ -8,5 +8,5 @@ import ajax from 'web.ajax'; * As we're not in an Odoo website context, the calls will not work, and we avoid a 404 request. */ ajax.loadJS = function (url) { - console.warn('Tried to load the following script on an external website: ' + url); + console.log('Tried to load the following script on an external website: ' + url); }; diff --git a/addons/im_livechat/tests/__init__.py b/addons/im_livechat/tests/__init__.py index a22a67032d1..f8b445619bb 100644 --- a/addons/im_livechat/tests/__init__.py +++ b/addons/im_livechat/tests/__init__.py @@ -2,3 +2,4 @@ # Part of Odoo. See LICENSE file for full copyright and licensing details. from . import test_get_mail_channel +from . import test_im_livechat_support_page diff --git a/addons/im_livechat/tests/test_im_livechat_support_page.py b/addons/im_livechat/tests/test_im_livechat_support_page.py new file mode 100644 index 00000000000..503499e8f92 --- /dev/null +++ b/addons/im_livechat/tests/test_im_livechat_support_page.py @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. + +import odoo +from odoo.tests import HttpCase + +@odoo.tests.tagged('-at_install', 'post_install') +class TestImLivechatSupportPage(HttpCase): + def test_load_modules(self): + """Checks that all javascript modules load correctly on the livechat support page""" + test_ready = """ + if (!window.testSetupHasRun) { + window.testSetupHasRun = true; + const setReady = () => odoo.__DEBUG__.didLogInfo.then(() => { + window.testIsReady = true; + }); + if (document.readyState === "complete") { + setReady(); + } else { + window.addEventListener("load", setReady); + } + } + window.testIsReady; + """ + + check_js_modules = """ + const { missing, failed, unloaded } = odoo.__DEBUG__.jsModules; + if ([missing, failed, unloaded].some(arr => arr.length)) { + console.error("Couldn't load all JS modules.", JSON.stringify({ missing, failed, unloaded })); + } else { + console.log("test successful"); + } + """ + self.browser_js("/im_livechat/support/1", code=check_js_modules, ready=test_ready)