Files
odoo_source/addons/calendar/static/tests/activity_menu_tests.js
T
7710c3331e [REF] mail, *: refactor Discuss
This commit refactors discuss code to use OWL components
and new tools and services in web/.
Functionally, Discuss app should work relatively the same as
before this commit.

closes https://github.com/odoo/odoo/pull/110188

Related:
https://github.com/odoo/enterprise/pull/38058
https://github.com/odoo/upgrade/pull/4423

closes odoo/odoo#110188

Related: odoo/upgrade#4423
Related: odoo/enterprise#38058
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Co-authored-by: Alexandre (aku) <aku@odoo.com>
Co-authored-by: Didier (did) <did@odoo.com>
Co-authored-by: Géry (ged) <ged@odoo.com>
Co-authored-by: Louis (wil) <wil@odoo.com>
Co-authored-by: Maël (mapa) <mapa@odoo.com>
Co-authored-by: Maryam (maki) <maki@odoo.com>
Co-authored-by: Sébastien (seb) <seb@odoo.com>
Co-authored-by: Thanh (tso) <tso@odoo.com>
Co-authored-by: Matthieu (tsm) <tsm@odoo.com>
Co-authored-by: Zelong (zel) <zel@odoo.com>
2023-03-17 11:47:09 +01:00

49 lines
1.9 KiB
JavaScript

/** @odoo-module **/
import { start, startServer, click } from "@mail/../tests/helpers/test_utils";
import { getFixture, patchDate, patchWithCleanup } from "@web/../tests/helpers/utils";
let target;
QUnit.module("calender activity menu", {
async beforeEach() {
target = getFixture();
},
});
QUnit.test("activity menu widget:today meetings", async function (assert) {
patchDate(2018, 3, 20, 6, 0, 0);
const pyEnv = await startServer();
const attendeeId = pyEnv["calendar.attendee"].create({ partner_id: pyEnv.currentPartnerId });
pyEnv["calendar.event"].create([
{
res_model: "calendar.event",
name: "meeting1",
start: "2018-04-20 06:30:00",
attendee_ids: [attendeeId],
},
{
res_model: "calendar.event",
name: "meeting2",
start: "2018-04-20 09:30:00",
attendee_ids: [attendeeId],
},
]);
const { env } = await start();
assert.containsOnce(target, ".o_menu_systray i[aria-label='Activities']");
await click(".o_menu_systray i[aria-label='Activities']");
patchWithCleanup(env.services.action, {
doAction(action) {
assert.strictEqual(action, "calendar.action_calendar_event");
assert.step("action");
},
});
assert.containsOnce(target, ".o-mail-ActivityGroup:contains(Today's Meetings)");
assert.containsN(target, ".o-mail-ActivityGroup .o-calendar-metting", 2);
assert.containsOnce(target, ".o-calendar-metting:contains(meeting1)");
assert.containsOnce(target, ".o-calendar-metting:contains(meeting2)");
assert.hasClass($(target).find("span:contains(meeting1)"), "fw-bold");
assert.doesNotHaveClass($(target).find("span:contains(meeting2)"), "fw-bold");
await click(".o-mail-ActivityMenu .o-mail-ActivityGroup");
assert.verifySteps(["action"]);
});