mirror of
https://github.com/bringout/oca-ocb-hr.git
synced 2026-04-26 07:32:04 +02:00
19.0 vanilla
This commit is contained in:
parent
a1137a1456
commit
e1d89e11e3
2789 changed files with 1093187 additions and 605897 deletions
|
|
@ -0,0 +1,45 @@
|
|||
import { describe, test } from "@odoo/hoot";
|
||||
|
||||
import { Store } from "@mail/core/common/store_service";
|
||||
import { startServer, start, openDiscuss, contains } from "@mail/../tests/mail_test_helpers";
|
||||
|
||||
import { serverState, patchWithCleanup } from "@web/../tests/web_test_helpers";
|
||||
import { defineHrHolidaysModels } from "@hr_holidays/../tests/hr_holidays_test_helpers";
|
||||
|
||||
describe.current.tags("desktop");
|
||||
defineHrHolidaysModels();
|
||||
|
||||
test("change icon on change partner im_status for leave variants", async () => {
|
||||
const pyEnv = await startServer();
|
||||
pyEnv["res.partner"].write([serverState.partnerId], { im_status: "online" });
|
||||
pyEnv["res.users"].write([serverState.userId], { leave_date_to: "2023-01-01" });
|
||||
const channelId = pyEnv["discuss.channel"].create({ channel_type: "chat" });
|
||||
patchWithCleanup(Store, { IM_STATUS_DEBOUNCE_DELAY: 0 });
|
||||
await start();
|
||||
await openDiscuss(channelId);
|
||||
await contains(
|
||||
".o-mail-DiscussContent-header .o-mail-ImStatus .fa-plane[title='On Leave (Online)']"
|
||||
);
|
||||
pyEnv["bus.bus"]._sendone("broadcast", "bus.bus/im_status_updated", {
|
||||
partner_id: serverState.partnerId,
|
||||
im_status: "leave_offline",
|
||||
presence_status: "offline",
|
||||
});
|
||||
await contains(".o-mail-DiscussContent-header .o-mail-ImStatus .fa-plane[title='On Leave']");
|
||||
pyEnv["bus.bus"]._sendone("broadcast", "bus.bus/im_status_updated", {
|
||||
partner_id: serverState.partnerId,
|
||||
im_status: "leave_away",
|
||||
presence_status: "away",
|
||||
});
|
||||
await contains(
|
||||
".o-mail-DiscussContent-header .o-mail-ImStatus .fa-plane[title='On Leave (Idle)']"
|
||||
);
|
||||
pyEnv["bus.bus"]._sendone("broadcast", "bus.bus/im_status_updated", {
|
||||
partner_id: serverState.partnerId,
|
||||
im_status: "leave_online",
|
||||
presence_status: "online",
|
||||
});
|
||||
await contains(
|
||||
".o-mail-DiscussContent-header .o-mail-ImStatus .fa-plane[title='On Leave (Online)']"
|
||||
);
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue