[FIX] calendar:tests: patch date in qunit test

Before this commit, the qunit test with activities in
calendar was relying on the current date to assert code
that show "today" activities.

This was working most of the time, but could fail at some
time of the day, like at midnight.

This commit fixes the issue by ensuring the test executes at
a specific date time, all the time.

closes odoo/odoo#90875

X-original-commit: 77fc727c05b0c9639581a3bc6ec6164d219988bf
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
This commit is contained in:
Alexandre Kühn
2022-05-09 15:01:17 +02:00
parent e061647856
commit 2fae2f08b6
@@ -4,6 +4,7 @@ import { start, startServer } from '@mail/../tests/helpers/test_utils';
import ActivityMenu from '@mail/js/systray/systray_activity_menu';
import testUtils from 'web.test_utils';
import { patchDate } from "@web/../tests/helpers/utils";
QUnit.module('calendar', {}, function () {
QUnit.module('ActivityMenu');
@@ -11,6 +12,7 @@ QUnit.module('ActivityMenu');
QUnit.test('activity menu widget:today meetings', async function (assert) {
assert.expect(6);
patchDate(2018, 3, 20, 6, 0, 0);
const pyEnv = await startServer();
const calendarAttendeeId1 = pyEnv['calendar.attendee'].create({ partner_id: pyEnv.currentPartnerId });
pyEnv['calendar.event'].create([