mirror of
https://github.com/bringout/oca-ocb-hr.git
synced 2026-04-25 11:52:00 +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,59 @@
|
|||
import { describe, test } from "@odoo/hoot";
|
||||
import { Command, serverState } from "@web/../tests/web_test_helpers";
|
||||
import { startServer, start, openDiscuss, contains } from "@mail/../tests/mail_test_helpers";
|
||||
import { defineHrHolidaysModels } from "@hr_holidays/../tests/hr_holidays_test_helpers";
|
||||
|
||||
describe.current.tags("desktop");
|
||||
defineHrHolidaysModels();
|
||||
|
||||
test("on leave & online", async () => {
|
||||
const pyEnv = await startServer();
|
||||
const partnerId = pyEnv["res.partner"].create({ name: "Demo", im_status: "online" });
|
||||
pyEnv["res.users"].create({ partner_id: partnerId, leave_date_to: "2023-01-01" });
|
||||
const channelId = pyEnv["discuss.channel"].create({
|
||||
channel_member_ids: [
|
||||
Command.create({ partner_id: serverState.partnerId }),
|
||||
Command.create({ partner_id: partnerId }),
|
||||
],
|
||||
channel_type: "chat",
|
||||
});
|
||||
await start();
|
||||
await openDiscuss(channelId);
|
||||
await contains(
|
||||
".o-mail-DiscussContent-header .o-mail-ImStatus i.fa-plane[title='On Leave (Online)']"
|
||||
);
|
||||
});
|
||||
|
||||
test("on leave & away", async () => {
|
||||
const pyEnv = await startServer();
|
||||
const partnerId = pyEnv["res.partner"].create({ name: "Demo", im_status: "away" });
|
||||
pyEnv["res.users"].create({ partner_id: partnerId, leave_date_to: "2023-01-01" });
|
||||
const channelId = pyEnv["discuss.channel"].create({
|
||||
channel_member_ids: [
|
||||
Command.create({ partner_id: serverState.partnerId }),
|
||||
Command.create({ partner_id: partnerId }),
|
||||
],
|
||||
channel_type: "chat",
|
||||
});
|
||||
await start();
|
||||
await openDiscuss(channelId);
|
||||
await contains(
|
||||
".o-mail-DiscussContent-header .o-mail-ImStatus i.fa-plane[title='On Leave (Idle)']"
|
||||
);
|
||||
});
|
||||
|
||||
test("on leave & offline", async () => {
|
||||
const pyEnv = await startServer();
|
||||
const partnerId = pyEnv["res.partner"].create({ name: "Demo", im_status: "offline" });
|
||||
pyEnv["res.users"].create({ partner_id: partnerId, leave_date_to: "2023-01-01" });
|
||||
const channelId = pyEnv["discuss.channel"].create({
|
||||
channel_member_ids: [
|
||||
Command.create({ partner_id: serverState.partnerId }),
|
||||
Command.create({ partner_id: partnerId }),
|
||||
],
|
||||
channel_type: "chat",
|
||||
});
|
||||
await start();
|
||||
await openDiscuss(channelId);
|
||||
await contains(".o-mail-DiscussContent-header .o-mail-ImStatus i.fa-plane[title='On Leave']");
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue