From 42a464d4215883833f2b1f44248e86d30cf6760c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 3 Mar 2026 13:36:31 +0000 Subject: [PATCH 1/3] Initial plan From 3a81241947afd04e4d50d49bca3d46712afdb634 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 3 Mar 2026 13:40:35 +0000 Subject: [PATCH 2/3] Tests: Use ES6 class syntax for inheritance in calendarFixtures.js Co-authored-by: r-farkhutdinov <23283554+r-farkhutdinov@users.noreply.github.com> --- .../testing/helpers/calendarFixtures.js | 163 +++++++++--------- 1 file changed, 84 insertions(+), 79 deletions(-) diff --git a/packages/devextreme/testing/helpers/calendarFixtures.js b/packages/devextreme/testing/helpers/calendarFixtures.js index 905ee592c731..59c2e9d558c8 100644 --- a/packages/devextreme/testing/helpers/calendarFixtures.js +++ b/packages/devextreme/testing/helpers/calendarFixtures.js @@ -1,91 +1,96 @@ import $ from 'jquery'; -import { noop } from 'core/utils/common'; -import Class from 'core/class'; import Views from '__internal/ui/calendar/calendar.views'; const TEXTEDITOR_INPUT_SELECTOR = '.dx-texteditor-input'; window.DevExpress = window.DevExpress || {}; +DevExpress.ui = DevExpress.ui || {}; +DevExpress.ui.testing = DevExpress.ui.testing || {}; -$.extend(true, DevExpress.ui = DevExpress.ui || {}, { - testing: { - BaseCalendarFixture: Class.inherit({ - extractArray: function(elements, delegate) { - return $.map($.makeArray(elements), delegate); - }, - extractInnerHTMLArray: function(elements) { - return this.extractArray(elements, function(element, index) { - return element.innerHTML; - }); - }, - extractInnerTextArray: function(elements) { - return this.extractArray(elements, function(element, index) { - return $(element).text(); - }); - }, - extractClassArray: function(elements) { - return this.extractArray(elements, function(element, index) { - return element.getAttribute('class') || ''; - }); - }, - typeIntoInput: function(dateString, input) { - const keyPress = $.Event('keypress'); - let i; - for(i = 0; i < dateString.length; ++i) { - keyPress.key = dateString[i]; - input.val(input.val() + dateString[i]); - input.trigger(keyPress); - } - } - }), - MockMonthView: Views['month'].inherit({ - renderHeader: noop, - renderBody: noop - }) +class BaseCalendarFixture { + extractArray(elements, delegate) { + return $.map($.makeArray(elements), delegate); } -}); -$.extend(true, DevExpress.ui, { - testing: { - CalendarFixture: DevExpress.ui.testing.BaseCalendarFixture.inherit({ - ctor: function(options) { - this.rootElement = $('
'); - this.rootElement.appendTo('body'); - this.calendar = $('#calendar') - .dxCalendar($.extend({ monthViewType: DevExpress.ui.testing.MockMonthView }, options)) - .dxCalendar('instance'); - this.navigatorLinks = { - 'prevYear': this.rootElement.find('.dx-calendar-navigator-previous-year'), - 'prevView': this.rootElement.find('.dx-calendar-navigator-previous-view'), - 'nextYear': this.rootElement.find('.dx-calendar-navigator-next-year'), - 'nextView': this.rootElement.find('.dx-calendar-navigator-next-view') - }; - }, - dispose: function() { - this.rootElement.remove(); - this.calendar = null; - } - }), + extractInnerHTMLArray(elements) { + return this.extractArray(elements, function(element) { + return element.innerHTML; + }); + } + + extractInnerTextArray(elements) { + return this.extractArray(elements, function(element) { + return $(element).text(); + }); + } + + extractClassArray(elements) { + return this.extractArray(elements, function(element) { + return element.getAttribute('class') || ''; + }); + } + + typeIntoInput(dateString, input) { + const keyPress = $.Event('keypress'); + for(let i = 0; i < dateString.length; ++i) { + keyPress.key = dateString[i]; + input.val(input.val() + dateString[i]); + input.trigger(keyPress); + } + } +} - DateBoxFixture: DevExpress.ui.testing.BaseCalendarFixture.inherit({ - ctor: function(element, options) { - this.format = 'shortdate'; - this.rootElement = $(element); +class MockMonthView extends Views['month'] { + renderHeader() {} + renderBody() {} +} - this.dateBox = this.rootElement - .dxDateBox($.extend(true, { - pickerType: 'calendar', - displayFormat: this.format, - calendarOptions: { monthViewType: DevExpress.ui.testing.MockMonthView } - }, options)) - .dxDateBox('instance'); - this.input = this.rootElement.find(TEXTEDITOR_INPUT_SELECTOR); - }, - dispose: function() { - this.rootElement.empty(); - $.cleanData(this.rootElement); - this.dateBox = null; - } - }) +class CalendarFixture extends BaseCalendarFixture { + constructor(options) { + super(); + this.rootElement = $(''); + this.rootElement.appendTo('body'); + this.calendar = $('#calendar') + .dxCalendar($.extend({ monthViewType: MockMonthView }, options)) + .dxCalendar('instance'); + this.navigatorLinks = { + 'prevYear': this.rootElement.find('.dx-calendar-navigator-previous-year'), + 'prevView': this.rootElement.find('.dx-calendar-navigator-previous-view'), + 'nextYear': this.rootElement.find('.dx-calendar-navigator-next-year'), + 'nextView': this.rootElement.find('.dx-calendar-navigator-next-view') + }; } -}); + + dispose() { + this.rootElement.remove(); + this.calendar = null; + } +} + +class DateBoxFixture extends BaseCalendarFixture { + constructor(element, options) { + super(); + this.format = 'shortdate'; + this.rootElement = $(element); + + this.dateBox = this.rootElement + .dxDateBox($.extend(true, { + pickerType: 'calendar', + displayFormat: this.format, + calendarOptions: { monthViewType: MockMonthView } + }, options)) + .dxDateBox('instance'); + this.input = this.rootElement.find(TEXTEDITOR_INPUT_SELECTOR); + } + + dispose() { + this.rootElement.empty(); + $.cleanData(this.rootElement); + this.dateBox = null; + } +} + +DevExpress.ui.testing.BaseCalendarFixture = BaseCalendarFixture; +DevExpress.ui.testing.MockMonthView = MockMonthView; +DevExpress.ui.testing.CalendarFixture = CalendarFixture; +DevExpress.ui.testing.DateBoxFixture = DateBoxFixture; From 62d0c44cfbfb7f4db0b1d7e29a1472fe9b821e62 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 3 Mar 2026 14:28:03 +0000 Subject: [PATCH 3/3] Remove MockMonthView and unrecognized monthViewType option from calendarFixtures Co-authored-by: r-farkhutdinov <23283554+r-farkhutdinov@users.noreply.github.com> --- .../devextreme/testing/helpers/calendarFixtures.js | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/packages/devextreme/testing/helpers/calendarFixtures.js b/packages/devextreme/testing/helpers/calendarFixtures.js index 59c2e9d558c8..efef5de6387a 100644 --- a/packages/devextreme/testing/helpers/calendarFixtures.js +++ b/packages/devextreme/testing/helpers/calendarFixtures.js @@ -1,5 +1,4 @@ import $ from 'jquery'; -import Views from '__internal/ui/calendar/calendar.views'; const TEXTEDITOR_INPUT_SELECTOR = '.dx-texteditor-input'; @@ -40,18 +39,13 @@ class BaseCalendarFixture { } } -class MockMonthView extends Views['month'] { - renderHeader() {} - renderBody() {} -} - class CalendarFixture extends BaseCalendarFixture { constructor(options) { super(); this.rootElement = $(''); this.rootElement.appendTo('body'); this.calendar = $('#calendar') - .dxCalendar($.extend({ monthViewType: MockMonthView }, options)) + .dxCalendar(options) .dxCalendar('instance'); this.navigatorLinks = { 'prevYear': this.rootElement.find('.dx-calendar-navigator-previous-year'), @@ -77,7 +71,6 @@ class DateBoxFixture extends BaseCalendarFixture { .dxDateBox($.extend(true, { pickerType: 'calendar', displayFormat: this.format, - calendarOptions: { monthViewType: MockMonthView } }, options)) .dxDateBox('instance'); this.input = this.rootElement.find(TEXTEDITOR_INPUT_SELECTOR); @@ -91,6 +84,5 @@ class DateBoxFixture extends BaseCalendarFixture { } DevExpress.ui.testing.BaseCalendarFixture = BaseCalendarFixture; -DevExpress.ui.testing.MockMonthView = MockMonthView; DevExpress.ui.testing.CalendarFixture = CalendarFixture; DevExpress.ui.testing.DateBoxFixture = DateBoxFixture;