1
0
forked from Mapan/odoo17e
odoo17e-kedaikipas58/addons/whatsapp/static/tests/messaging_menu_patch_tests.js
2024-12-10 09:04:09 +07:00

36 lines
1.2 KiB
JavaScript

/* @odoo-module */
import { startServer } from "@bus/../tests/helpers/mock_python_environment";
import { Command } from "@mail/../tests/helpers/command";
import { start } from "@mail/../tests/helpers/test_utils";
import { click, contains } from "@web/../tests/utils";
QUnit.module("messaging menu (patch)");
QUnit.test("WhatsApp Channel notification items should have thread icon", async () => {
const pyEnv = await startServer();
pyEnv["discuss.channel"].create({
name: "WhatsApp 1",
channel_type: "whatsapp",
});
await start();
await click(".o_menu_systray i[aria-label='Messages']");
await contains(".o-mail-NotificationItem .o-mail-ThreadIcon");
});
QUnit.test("Notification items should have unread counter for unread messages", async () => {
const pyEnv = await startServer();
pyEnv["discuss.channel"].create({
name: "WhatsApp 1",
channel_type: "whatsapp",
channel_member_ids: [
Command.create({ message_unread_counter: 1, partner_id: pyEnv.currentPartnerId }),
],
});
await start();
await click(".o_menu_systray i[aria-label='Messages']");
await contains(".o-mail-MessagingMenu-counter", { text: "1" });
});