mirror of
https://github.com/bringout/oca-ocb-crm.git
synced 2026-04-22 00:32:11 +02:00
19.0 vanilla
This commit is contained in:
parent
dc68f80d3f
commit
7221b9ac46
610 changed files with 135477 additions and 161677 deletions
|
|
@ -0,0 +1,40 @@
|
|||
import { defineCrmLivechatModels } from "@crm_livechat/../tests/crm_livechat_test_helpers";
|
||||
import { describe, test } from "@odoo/hoot";
|
||||
import {
|
||||
click,
|
||||
contains,
|
||||
insertText,
|
||||
openDiscuss,
|
||||
start,
|
||||
startServer,
|
||||
} from "@mail/../tests/mail_test_helpers";
|
||||
import { Command, serverState } from "@web/../tests/web_test_helpers";
|
||||
|
||||
describe.current.tags("desktop");
|
||||
defineCrmLivechatModels();
|
||||
|
||||
test("Can open lead from internal link", async () => {
|
||||
const pyEnv = await startServer();
|
||||
pyEnv["res.users"].write([serverState.userId], {
|
||||
group_ids: pyEnv["res.groups"]
|
||||
.search_read([["id", "=", serverState.groupLivechatId]])
|
||||
.map(({ id }) => id),
|
||||
});
|
||||
const guestId = pyEnv["mail.guest"].create({ name: "Visitor" });
|
||||
const channelId = pyEnv["discuss.channel"].create({
|
||||
channel_member_ids: [
|
||||
Command.create({ partner_id: serverState.partnerId, livechat_member_type: "agent" }),
|
||||
Command.create({ guest_id: guestId, livechat_member_type: "visitor" }),
|
||||
],
|
||||
channel_type: "livechat",
|
||||
livechat_operator_id: serverState.partnerId,
|
||||
});
|
||||
await start();
|
||||
await openDiscuss(channelId);
|
||||
await insertText(".o-mail-Composer-input", "/lead My Lead");
|
||||
await click(".o-mail-Composer button[title='Send']:enabled");
|
||||
await contains(".o-mail-ChatWindow", { count: 0 });
|
||||
await click('.o_mail_notification a[data-oe-model="crm.lead"]');
|
||||
await contains(".o-mail-ChatWindow-header", { text: "Visitor" });
|
||||
await contains(".o_form_view .o_last_breadcrumb_item span", { text: "My Lead" });
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue