mirror of
https://github.com/bringout/oca-ocb-core.git
synced 2026-04-21 06:12:04 +02:00
19.0 vanilla
This commit is contained in:
parent
d1963a3c3a
commit
2d3ee4855a
7430 changed files with 2687981 additions and 2965473 deletions
|
|
@ -0,0 +1,50 @@
|
|||
import { describe, expect, test } from "@odoo/hoot";
|
||||
import { queryFirst, waitFor } from "@odoo/hoot-dom";
|
||||
import {
|
||||
asyncStep,
|
||||
makeMockEnv,
|
||||
MockServer,
|
||||
mockService,
|
||||
mountWithCleanup,
|
||||
serverState,
|
||||
waitForSteps,
|
||||
} from "@web/../tests/web_test_helpers";
|
||||
import { WebClient } from "@web/webclient/webclient";
|
||||
import { defineBusModels } from "./bus_test_helpers";
|
||||
|
||||
defineBusModels();
|
||||
describe.current.tags("desktop");
|
||||
|
||||
test("receive and display simple notification", async () => {
|
||||
await mountWithCleanup(WebClient);
|
||||
MockServer.env["bus.bus"]._sendone(serverState.partnerId, "simple_notification", {
|
||||
message: "simple notification",
|
||||
});
|
||||
await waitFor(".o_notification");
|
||||
expect(queryFirst(".o_notification_content")).toHaveText("simple notification");
|
||||
});
|
||||
|
||||
test("receive and display simple notification with specific type", async () => {
|
||||
await mountWithCleanup(WebClient);
|
||||
MockServer.env["bus.bus"]._sendone(serverState.partnerId, "simple_notification", {
|
||||
message: "simple notification",
|
||||
type: "info",
|
||||
});
|
||||
await waitFor(".o_notification");
|
||||
expect(".o_notification_bar").toHaveClass("bg-info");
|
||||
});
|
||||
|
||||
test("receive and display simple notification as sticky", async () => {
|
||||
mockService("notification", {
|
||||
add(_, options) {
|
||||
expect(options.sticky).toBe(true);
|
||||
asyncStep("add notification");
|
||||
},
|
||||
});
|
||||
await makeMockEnv();
|
||||
MockServer.env["bus.bus"]._sendone(serverState.partnerId, "simple_notification", {
|
||||
message: "simple notification",
|
||||
sticky: true,
|
||||
});
|
||||
await waitForSteps(["add notification"]);
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue