From 70f840999b67515bc7d7220321c8e39bec2adefc Mon Sep 17 00:00:00 2001 From: Kevin Baptiste Date: Mon, 3 Apr 2023 06:43:48 +0000 Subject: [PATCH] [FIX] hr_holidays: ensure clicked element is visible in test The test tour `time_off_request_calendar_view` would fail once the first Thursday of the year was not visible to the user (e.g. on the 1st April) as the MouseEvents would not be fired. closes odoo/odoo#117440 Signed-off-by: Kevin Baptiste --- .../static/tests/tours/time_off_request_calendar_view.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/hr_holidays/static/tests/tours/time_off_request_calendar_view.js b/addons/hr_holidays/static/tests/tours/time_off_request_calendar_view.js index ab60d8cfa06fc..52b9c87c8ea87 100644 --- a/addons/hr_holidays/static/tests/tours/time_off_request_calendar_view.js +++ b/addons/hr_holidays/static/tests/tours/time_off_request_calendar_view.js @@ -18,6 +18,8 @@ tour.register('time_off_request_calendar_view', { trigger: '.fc-day-top.fc-thu', run: () => { const el = document.querySelector('.fc-day-top.fc-thu').firstChild; + el.scrollIntoView(); + const fromPosition = el.getBoundingClientRect(); fromPosition.x += el.offsetWidth / 2; fromPosition.y += el.offsetHeight / 2;