The OWL component documents.ControlPanel of the Odoo documents module has been extended by our Odoo custom module.
The extended code relies on a documents.custom service that is registered by our Odoo custom module.
All is running fine on the deployed instance. However, we are facing a regression on the existing documents tests bench, odoo.addons.web.tests.test_js.WebSuite.test_qunit_desktop.browser is in failure, caused by: Error: Service document.custom is not available when running the QUnit test odoo/addons/documents/static/tests/documents_kanban_tests.js
As can be seen in the beforeEach function implementation, it seems that the services that are loaded during the tests are hardcoded, and our document.custom service is not loaded.
QUnit.module("documents", {}, function () {QUnit.module(
"documents_kanban_tests.js",
{
async beforeEach() {
loadServices();
The goal is to make our document.custom service available in the base module QUnit tests, without modifying these lower level related test files.
We tried adding the document.custom service implementation and registration in the web.tests_assets of the Odoo custom module manifest, in the hope that the document.custom service would be visible to the base module QUnit tests, but same does not solve the issue.
'assets': {'web.tests_assets': [
'custom/static/src/js/custom_documents_service.js',
],
Extending OWL components is great, but it is important to keep the tests green.
Any tips on how to fix this issue ?