From 2fae2f08b6c6d06d3018892ba10a6f49f02e8628 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20K=C3=BChn?= Date: Mon, 9 May 2022 09:28:46 +0000 Subject: [PATCH] [FIX] calendar:tests: patch date in qunit test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- addons/calendar/static/tests/systray_activity_menu_tests.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/calendar/static/tests/systray_activity_menu_tests.js b/addons/calendar/static/tests/systray_activity_menu_tests.js index f77769d8bea..91d2b2b8ba7 100644 --- a/addons/calendar/static/tests/systray_activity_menu_tests.js +++ b/addons/calendar/static/tests/systray_activity_menu_tests.js @@ -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([