summaryrefslogtreecommitdiff
path: root/addons/website/static/tests
diff options
context:
space:
mode:
authorqsm-odoo <qsm@odoo.com>2020-02-03 18:06:39 +0000
committerqsm-odoo <qsm@odoo.com>2020-02-05 10:48:44 +0000
commit6f4c60fe1bb6e460ec6da00c59a9825271893729 (patch)
tree1e1daccae6866dcceba5854a1f2dd26aacfd7777 /addons/website/static/tests
parentd04ca05b2ee33ee270866ba9ac8eed61a251c1ed (diff)
[FIX] website, *: lazy load widget assets of the correct website
*: web Before this commit, when a widget declared assets to lazy load through the assetLibs key, the asset was loaded through a context-less call to the server through the base `rpc` function. This caused problems in website: the website ID was not given to the called route and the loaded assets were then stripped of their specific-website parts. This commit solves the problem by allowing the `loadLibs` and `loadAsset` functions to receive an extra argument: an extra `context` to use for the actual call to the server. The method is now available in the ajax service, so that website can add its custom context automatically, the same way it does it for normal `_rpc` calls. Part of https://github.com/odoo/odoo/pull/44596 closes odoo/odoo#44596 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Diffstat (limited to 'addons/website/static/tests')
-rw-r--r--addons/website/static/tests/tours/specific_website_editor.js29
1 files changed, 29 insertions, 0 deletions
diff --git a/addons/website/static/tests/tours/specific_website_editor.js b/addons/website/static/tests/tours/specific_website_editor.js
new file mode 100644
index 00000000000..b51256670b1
--- /dev/null
+++ b/addons/website/static/tests/tours/specific_website_editor.js
@@ -0,0 +1,29 @@
+odoo.define('website.tour.specific_website_editor', function (require) {
+'use strict';
+
+var tour = require('web_tour.tour');
+
+tour.register('generic_website_editor', {
+ test: true,
+}, [{
+ trigger: 'a[data-action=edit]',
+ content: 'Click edit button',
+}, {
+ trigger: 'body:not([data-hello="world"])',
+ extra_trigger: '#oe_snippets.o_loaded',
+ content: 'Check that the editor DOM matches its website-generic features',
+ run: function () {}, // Simple check
+}]);
+
+tour.register('specific_website_editor', {
+ test: true,
+}, [{
+ trigger: 'a[data-action=edit]',
+ content: 'Click edit button',
+}, {
+ trigger: 'body[data-hello="world"]',
+ extra_trigger: '#oe_snippets.o_loaded',
+ content: 'Check that the editor DOM matches its website-specific features',
+ run: function () {}, // Simple check
+}]);
+});