[FIX] im_livechat: add missing dependencies to manifest

The dependencies of the public_root module were recently updated, but
the manifest of im_livechat was not, causing it to fail to load. This
commit adds those missing dependencies to the manifest.

This commit also adds a test that checks that all modules are properly
loaded on the support page, since this has been broken on multiple
occasions while changing the dependencies or the path of some of the
modules this page needs to work.

closes odoo/odoo#74756

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
This commit is contained in:
Samuel Degueldre
2021-08-06 10:15:23 +00:00
parent 64fc704527
commit 37aca4a38e
4 changed files with 40 additions and 2 deletions
+4 -1
View File
@@ -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',
@@ -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);
};
+1
View File
@@ -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
@@ -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)