[FIX] mail: remove duplicate steps in discuss guest tour

`discuss_public_tour` is ran after `discuss_channel_as_guest_tour`
leading to all steps presents in both to be executed twice.

The opportunity is taken to add empty `run` functions to avoid
unnecessary clicks.

Part-of: odoo/odoo#128290
This commit is contained in:
Sébastien Theys
2023-07-13 08:28:05 +02:00
parent 4333b16d8c
commit fac4c9c1c5
2 changed files with 4 additions and 57 deletions
@@ -1,7 +1,6 @@
/* @odoo-module */
import { registry } from "@web/core/registry";
import { createFile, inputFiles } from "web.test_utils_file";
registry
.category("web_tour.tours")
@@ -25,63 +24,7 @@ registry
{
content: "Check that we are on channel page",
trigger: ".o-mail-Thread",
run() {
// Wait for modules to be loaded or failed for the next step
odoo.__DEBUG__.didLogInfo.then(() => {
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 })
);
}
document.body.classList.add(
"o_discuss_channel_as_guest_tour_modules_loaded"
);
});
},
extraTrigger: ".o_discuss_channel_as_guest_tour_modules_loaded",
},
{
content: "Wait for all modules loaded check in previous step",
trigger: ".o_discuss_channel_as_guest_tour_modules_loaded",
},
{
content: "Write something in composer",
trigger: ".o-mail-Composer-input",
run: "text cheese",
},
{
content: "Add one file in composer",
trigger: ".o-mail-Composer button[aria-label='Attach files']",
async run() {
const file = await createFile({
content: "hello, world",
contentType: "text/plain",
name: "text.txt",
});
inputFiles(document.querySelector(".o-mail-Composer-coreMain .o_input_file"), [
file,
]);
},
},
{
content: "Check the earlier provided attachment is listed",
trigger: '.o-mail-AttachmentCard[title="text.txt"]',
extra_trigger: ".o-mail-AttachmentCard:not(.o-isUploading)", // waiting the attachment to be uploaded
run() {},
},
{
content: "Send message",
trigger: ".o-mail-Composer-send",
},
{
content: "Check message is shown",
trigger: '.o-mail-Message-body:contains("cheese")',
},
{
content: "Check message contains the attachment",
trigger: '.o-mail-Message .o-mail-AttachmentCard:contains("text.txt")',
},
],
});
@@ -9,6 +9,7 @@ registry.category("web_tour.tours").add("mail/static/tests/tours/discuss_public_
{
trigger: ".o-mail-DiscussPublic",
extraTrigger: ".o-mail-Thread",
run() {},
},
{
content: "Check that we are on channel page",
@@ -34,6 +35,7 @@ registry.category("web_tour.tours").add("mail/static/tests/tours/discuss_public_
{
content: "Wait for all modules loaded check in previous step",
trigger: ".o_discuss_channel_public_modules_loaded",
run() {},
},
{
content: "Write something in composer",
@@ -67,10 +69,12 @@ registry.category("web_tour.tours").add("mail/static/tests/tours/discuss_public_
{
content: "Check message is shown",
trigger: '.o-mail-Message-body:contains("cheese")',
run() {},
},
{
content: "Check message contains the attachment",
trigger: '.o-mail-Message .o-mail-AttachmentCard:contains("text.txt")',
run() {},
},
],
});