diff --git a/addons/website/static/tests/tours/snippets_all_drag_and_drop.js b/addons/website/static/tests/tours/snippets_all_drag_and_drop.js index 03c4c9045eb..7ab93e6f71b 100644 --- a/addons/website/static/tests/tours/snippets_all_drag_and_drop.js +++ b/addons/website/static/tests/tours/snippets_all_drag_and_drop.js @@ -1,6 +1,15 @@ odoo.define("website.tour.snippets_all_drag_and_drop", async function (require) { "use strict"; +const snippetsEditor = require('web_editor.snippet.editor'); + +snippetsEditor.SnippetEditor.include({ + removeSnippet: async function (shouldRecordUndo = true) { + await this._super(...arguments); + $('body').attr('test-dd-snippet-removed', true); + }, +}); + const tour = require("web_tour.tour"); let snippetsNames = (new URL(document.location.href)).searchParams.get('snippets_names') || ''; @@ -25,13 +34,11 @@ for (const snippet of snippetsNames) { trigger: "we-button.oe_snippet_remove:last" }, { content: `click on 'BLOCKS' tab (${snippet})`, + extra_trigger: 'body[test-dd-snippet-removed]', trigger: ".o_we_add_snippet_btn", run: function (actions) { - // FIXME cannot find the reason why this setTimeout is needed to - // after reverting ab7508393376075f95d6dd5925e7f4462936d2, to check - // (this commit is however reverted temporarily until a better - // solution is found). - setTimeout(() => actions.auto(), 0); + $('body').removeAttr('test-dd-snippet-removed'); + actions.auto(); }, }];