mirror of
https://github.com/bringout/oca-ocb-technical.git
synced 2026-04-23 23:52:06 +02:00
19.0 vanilla
This commit is contained in:
parent
5faf7397c5
commit
2696f14ed7
721 changed files with 220375 additions and 91221 deletions
|
|
@ -0,0 +1,78 @@
|
|||
import { defineCalendarModels } from "@calendar/../tests/calendar_test_helpers";
|
||||
import { click, contains, start, startServer } from "@mail/../tests/mail_test_helpers";
|
||||
import { test } from "@odoo/hoot";
|
||||
import {
|
||||
asyncStep,
|
||||
mockService,
|
||||
onRpc,
|
||||
preloadBundle,
|
||||
serverState,
|
||||
waitForSteps,
|
||||
} from "@web/../tests/web_test_helpers";
|
||||
|
||||
defineCalendarModels();
|
||||
preloadBundle("web.fullcalendar_lib");
|
||||
|
||||
test("can listen on bus and display notifications in DOM and click OK", async () => {
|
||||
const pyEnv = await startServer();
|
||||
onRpc("/calendar/notify_ack", () => asyncStep("notify_ack"));
|
||||
await start();
|
||||
pyEnv["bus.bus"]._sendone(serverState.partnerId, "calendar.alarm", [
|
||||
{
|
||||
alarm_id: 1,
|
||||
event_id: 2,
|
||||
title: "Meeting",
|
||||
message: "Very old meeting message",
|
||||
timer: 0,
|
||||
notify_at: "1978-04-14 12:45:00",
|
||||
},
|
||||
]);
|
||||
await contains(".o_notification", { text: "Meeting. Very old meeting message" });
|
||||
await click(".o_notification_buttons button", { text: "OK" });
|
||||
await contains(".o_notification", { count: 0 });
|
||||
await waitForSteps(["notify_ack"]);
|
||||
});
|
||||
|
||||
test("can listen on bus and display notifications in DOM and click Detail", async () => {
|
||||
mockService("action", {
|
||||
doAction(actionId) {
|
||||
asyncStep(actionId.type);
|
||||
},
|
||||
});
|
||||
const pyEnv = await startServer();
|
||||
await start();
|
||||
pyEnv["bus.bus"]._sendone(serverState.partnerId, "calendar.alarm", [
|
||||
{
|
||||
alarm_id: 1,
|
||||
event_id: 2,
|
||||
title: "Meeting",
|
||||
message: "Very old meeting message",
|
||||
timer: 0,
|
||||
notify_at: "1978-04-14 12:45:00",
|
||||
},
|
||||
]);
|
||||
await contains(".o_notification", { text: "Meeting. Very old meeting message" });
|
||||
await click(".o_notification_buttons button", { text: "Details" });
|
||||
await contains(".o_notification", { count: 0 });
|
||||
await waitForSteps(["ir.actions.act_window"]);
|
||||
});
|
||||
|
||||
test("can listen on bus and display notifications in DOM and click Snooze", async () => {
|
||||
const pyEnv = await startServer();
|
||||
onRpc("/calendar/notify_ack", () => asyncStep("notify_ack"));
|
||||
await start();
|
||||
pyEnv["bus.bus"]._sendone(serverState.partnerId, "calendar.alarm", [
|
||||
{
|
||||
alarm_id: 1,
|
||||
event_id: 2,
|
||||
title: "Meeting",
|
||||
message: "Very old meeting message",
|
||||
timer: 0,
|
||||
notify_at: "1978-04-14 12:45:00",
|
||||
},
|
||||
]);
|
||||
await contains(".o_notification", { text: "Meeting. Very old meeting message" });
|
||||
await click(".o_notification button", { text: "Snooze" });
|
||||
await contains(".o_notification", { count: 0 });
|
||||
await waitForSteps([]);
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue