mirror of
https://github.com/bringout/oca-ocb-mail.git
synced 2026-04-21 22:41:59 +02:00
47 lines
2.2 KiB
JavaScript
47 lines
2.2 KiB
JavaScript
import { click, contains, patchUiSize, start, startServer } from "@mail/../tests/mail_test_helpers";
|
|
import { describe, test } from "@odoo/hoot";
|
|
import { Command, serverState } from "@web/../tests/web_test_helpers";
|
|
import { defineLivechatModels } from "./livechat_test_helpers";
|
|
|
|
describe.current.tags("desktop");
|
|
defineLivechatModels();
|
|
|
|
test('livechats should be in "chat" filter', async () => {
|
|
const pyEnv = await startServer();
|
|
const guestId = pyEnv["mail.guest"].create({ name: "Visitor 11" });
|
|
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 click(".o_menu_systray i[aria-label='Messages']");
|
|
await contains(".o-mail-MessagingMenu button.fw-bold", { text: "Notifications" });
|
|
await contains(".o-mail-NotificationItem", { text: "Visitor 11" });
|
|
await click(".o-mail-MessagingMenu button", { text: "Chats" });
|
|
await contains(".o-mail-MessagingMenu button.fw-bold", { text: "Chats" });
|
|
await contains(".o-mail-NotificationItem", { text: "Visitor 11" });
|
|
});
|
|
|
|
test('livechats should be in "livechat" tab in mobile', async () => {
|
|
patchUiSize({ height: 360, width: 640 });
|
|
const pyEnv = await startServer();
|
|
const guestId = pyEnv["mail.guest"].create({ name: "Visitor 11" });
|
|
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 click(".o_menu_systray i[aria-label='Messages']");
|
|
await click("button", { text: "Live Chats" });
|
|
await contains(".o-mail-NotificationItem", { text: "Visitor 11" });
|
|
await click("button", { text: "Chats" });
|
|
await contains(".o-mail-NotificationItem", { count: 0, text: "Visitor 11" });
|
|
});
|