summaryrefslogtreecommitdiff
path: root/addons/web/static/tests/helpers/test_utils.js
diff options
context:
space:
mode:
Diffstat (limited to 'addons/web/static/tests/helpers/test_utils.js')
-rw-r--r--addons/web/static/tests/helpers/test_utils.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/addons/web/static/tests/helpers/test_utils.js b/addons/web/static/tests/helpers/test_utils.js
index 6c05076ef98..0aa9f7acaad 100644
--- a/addons/web/static/tests/helpers/test_utils.js
+++ b/addons/web/static/tests/helpers/test_utils.js
@@ -289,6 +289,9 @@ function createAsyncView(params) {
* up in the init process of the view, because there are no other way to do it
* after this method returns. Some events ('call_service', "load_views",
* "get_session", "load_filters") have a special treatment beforehand.
+ * @param {web.AbstractService[]} [params.services] list of services to load in
+ * addition to the ajax service. For instance, if a test needs the local
+ * storage service in order to work, it can provide a mock version of it.
* @param {boolean} [debounce=true] set to false to completely remove the
* debouncing, forcing the handler to be called directly (not on the next
* execution stack, like it does with delay=0).
@@ -315,6 +318,7 @@ function addMockEnvironment(widget, params) {
archs: params.archs,
currentDate: params.currentDate,
debug: params.debug,
+ services: params.services,
});
// make sure images do not trigger a GET on the server
@@ -431,6 +435,7 @@ function addMockEnvironment(widget, params) {
if (index !== -1) {
var Service = params.services.splice(index, 1)[0];
services[Service.prototype.name] = new Service(widget);
+ services[Service.prototype.name].start();
} else {
done = true;
}