mirror of
https://github.com/bringout/oca-ocb-mail.git
synced 2026-04-22 09:42:05 +02:00
19.0 vanilla
This commit is contained in:
parent
5df8c07b59
commit
daa394e8b0
2114 changed files with 564841 additions and 299642 deletions
|
|
@ -0,0 +1,38 @@
|
|||
import { contains, openDiscuss, start, startServer } from "@mail/../tests/mail_test_helpers";
|
||||
import { withGuest } from "@mail/../tests/mock_server/mail_mock_server";
|
||||
import { describe, test } from "@odoo/hoot";
|
||||
import { Command, serverState } from "@web/../tests/web_test_helpers";
|
||||
|
||||
import { rpc } from "@web/core/network/rpc";
|
||||
import { defineLivechatModels } from "./livechat_test_helpers";
|
||||
|
||||
describe.current.tags("desktop");
|
||||
defineLivechatModels();
|
||||
|
||||
test("Public website visitor is typing", async () => {
|
||||
const pyEnv = await startServer();
|
||||
const guestId = pyEnv["mail.guest"].create({ name: "Visitor 20" });
|
||||
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 contains(".o-mail-DiscussContent-header .o-mail-ThreadIcon .fa.fa-circle-o");
|
||||
const channel = pyEnv["discuss.channel"].search_read([["id", "=", channelId]])[0];
|
||||
// simulate receive typing notification from livechat visitor "is typing"
|
||||
withGuest(guestId, () =>
|
||||
rpc("/discuss/channel/notify_typing", {
|
||||
is_typing: true,
|
||||
channel_id: channel.id,
|
||||
})
|
||||
);
|
||||
await contains(".o-mail-DiscussContent-header .o-discuss-Typing-icon");
|
||||
await contains(
|
||||
".o-mail-DiscussContent-header .o-discuss-Typing-icon[title='Visitor 20 is typing...']"
|
||||
);
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue