diff --git a/js/ui/scheduler/ui.scheduler.appointments.js b/js/ui/scheduler/ui.scheduler.appointments.js index 51173a2ab6ea..a5927a9da9d5 100644 --- a/js/ui/scheduler/ui.scheduler.appointments.js +++ b/js/ui/scheduler/ui.scheduler.appointments.js @@ -719,7 +719,7 @@ const SchedulerAppointments = CollectionWidget.inherit({ }; } - appointmentSetting.targetedAppointmentData = this.invoke('getTargetedAppointmentData', appointmentData, $appointment, true); + appointmentSetting.targetedAppointmentData = this.invoke('getTargetedAppointmentData', appointmentData, $appointment); this._virtualAppointments[virtualGroupIndex].items.settings.push(appointmentSetting); this._virtualAppointments[virtualGroupIndex].items.data.push(appointmentData); diff --git a/js/ui/scheduler/ui.scheduler.subscribes.js b/js/ui/scheduler/ui.scheduler.subscribes.js index 36d30630ec19..bded96c8d134 100644 --- a/js/ui/scheduler/ui.scheduler.subscribes.js +++ b/js/ui/scheduler/ui.scheduler.subscribes.js @@ -765,7 +765,7 @@ const subscribes = { return SchedulerTimezones.getTimezonesIdsByDisplayName(displayName); }, - getTargetedAppointmentData: function(appointmentData, appointmentElement, skipTimezoneConvert) { + getTargetedAppointmentData: function(appointmentData, appointmentElement) { const $appointmentElement = $(appointmentElement); const appointmentIndex = $appointmentElement.data(this._appointments._itemIndexKey()); @@ -778,7 +778,7 @@ const subscribes = { extend(true, result, appointmentData, recurringData); - if(this._isAppointmentRecurrence(appointmentData) && !skipTimezoneConvert) { + if(this._isAppointmentRecurrence(appointmentData)) { this._convertDatesByTimezoneBack(false, result); // TODO: temporary solution fox fix T848058, more information in the ticket } diff --git a/testing/tests/DevExpress.ui.widgets.scheduler/integration.appointments.tests.js b/testing/tests/DevExpress.ui.widgets.scheduler/integration.appointments.tests.js index ffce3bb4d4c4..d4e5a9870e90 100644 --- a/testing/tests/DevExpress.ui.widgets.scheduler/integration.appointments.tests.js +++ b/testing/tests/DevExpress.ui.widgets.scheduler/integration.appointments.tests.js @@ -3821,7 +3821,7 @@ QUnit.module('Appointments', () => { return createWrapper($.extend(config, options)); }; - const createTestForCommonData = (assert, skipCallCount = false) => { + const createTestForCommonData = (assert, scheduler, skipCallCount = false) => { eventCallCount = 0; return (model, index, container) => { @@ -3841,7 +3841,6 @@ QUnit.module('Appointments', () => { return (model, index, container) => { const { appointmentData, targetedAppointmentData } = model; - const startDateExpr = scheduler.option('startDateExpr'); const endDateExpr = scheduler.option('endDateExpr'); const textExpr = scheduler.option('textExpr'); @@ -3983,54 +3982,58 @@ QUnit.module('Appointments', () => { }); QUnit.module('appointmentTooltipTemplate', () => { - QUnit.test('model.targetedAppointmentData argument should have current appointment data', function(assert) { - const scheduler = createScheduler(commonData); - scheduler.option({ appointmentTooltipTemplate: createTestForCommonData(assert, true) }); - - for(let i = 0; i < 5; i++) { - scheduler.appointments.click(i); - } - - assert.ok(eventCallCount === 5, 'appointmentTemplate should be raised'); - }); - - QUnit.test('model.targetedAppointmentData argument should have current appointment data in case recurrence', function(assert) { - const scheduler = createScheduler(recurrenceData); - scheduler.option({ appointmentTooltipTemplate: createTestForRecurrenceData(assert, scheduler) }); - - for(let i = 0; i < 5; i++) { - scheduler.appointments.click(i); + const cases = [ + { + data: commonData, + appointmentTooltip: createTestForCommonData, + name: 'common' + }, + { + data: recurrenceData, + appointmentTooltip: createTestForRecurrenceData, + name: 'recurrence' + }, + { + data: recurrenceAndCompactData, + appointmentTooltip: createTestForRecurrenceData, + name: 'recurrence in collector' + }, + { + data: hourlyRecurrenceData, + options: { + textExpr: 'textCustom', + startDateExpr: 'startDateCustom', + endDateExpr: 'endDateCustom', + currentView: 'week' + }, + appointmentTooltip: createTestForHourlyRecurrenceData, + name: 'hourly recurrence in collector' + }, + { + data: hourlyRecurrenceData, + options: { + textExpr: 'textCustom', + startDateExpr: 'startDateCustom', + endDateExpr: 'endDateCustom', + currentView: 'week', + timeZone: 'Asia/Yekaterinburg' + }, + appointmentTooltip: createTestForHourlyRecurrenceData, + name: 'hourly recurrence in collector, custom timezone is set' } + ]; - assert.ok(eventCallCount === 5, 'appointmentTooltipTemplate should be raised'); - }); - - QUnit.test('model.targetedAppointmentData argument should have current appointment data in case recurrence in collector', function(assert) { - const scheduler = createScheduler(recurrenceAndCompactData); - scheduler.option({ appointmentTooltipTemplate: createTestForRecurrenceData(assert, scheduler) }); - - for(let i = 0; i < 5; i++) { - scheduler.appointments.compact.click(i); - } + cases.forEach(testCase => { + QUnit.test(`model.targetedAppointmentData argument should have current appointment data, ${testCase.name} case`, function(assert) { + const scheduler = createScheduler(testCase.data, testCase.options); + scheduler.option('appointmentTooltipTemplate', testCase.appointmentTooltip(assert, scheduler, true)); - assert.ok(eventCallCount === 5, 'appointmentTooltipTemplate should be raised'); - }); + for(let i = 0; i < 5; i++) { + scheduler.appointments.click(i); + } - QUnit.test('model.targetedAppointmentData argument should have current appointment data in case hourly recurrence in collector', function(assert) { - const scheduler = createScheduler(hourlyRecurrenceData, { - textExpr: 'textCustom', - startDateExpr: 'startDateCustom', - endDateExpr: 'endDateCustom', - currentView: 'week' + assert.ok(eventCallCount === 5, 'appointmentTemplate should be raised'); }); - - scheduler.option({ appointmentTooltipTemplate: createTestForHourlyRecurrenceData(assert, scheduler) }); - - for(let i = 0; i < 5; i++) { - scheduler.appointments.compact.click(i); - } - - assert.ok(eventCallCount === 5, 'appointmentTooltipTemplate should be raised'); }); });