Odoo18-Base/addons/crm_livechat/static/tests/composer.test.js

31 lines
911 B
JavaScript
Raw Permalink Normal View History

2025-01-06 10:57:38 +07:00
import { describe, expect, test } from "@odoo/hoot";
import {
assertSteps,
click,
defineMailModels,
insertText,
openDiscuss,
start,
startServer,
step,
} from "@mail/../tests/mail_test_helpers";
import { onRpc } from "@web/../tests/web_test_helpers";
describe.current.tags("desktop");
defineMailModels();
test("Can execute lead command", async () => {
const pyEnv = await startServer();
const channelId = pyEnv["discuss.channel"].create({ name: "General" });
await start();
onRpc("discuss.channel", "execute_command_lead", (params) => {
step("execute_command_lead");
expect(params.args[0]).toEqual([channelId]);
return true;
});
await openDiscuss(channelId);
await insertText(".o-mail-Composer-input", "/lead great lead");
await click(".o-mail-Composer-send:enabled");
await assertSteps(["execute_command_lead"]);
});