Skip to content

Tests: Use ES6 class syntax for inheritance in calendarFixtures.js#32769

Merged
r-farkhutdinov merged 3 commits into26_1from
copilot/update-inheritance-es6-syntax
Mar 4, 2026
Merged

Tests: Use ES6 class syntax for inheritance in calendarFixtures.js#32769
r-farkhutdinov merged 3 commits into26_1from
copilot/update-inheritance-es6-syntax

Conversation

Copy link
Contributor

Copilot AI commented Mar 3, 2026

Replaces the legacy Class.inherit() pattern with ES6 class/extends syntax in testing/helpers/calendarFixtures.js, and removes the unused MockMonthView class along with the unrecognized monthViewType option.

Changes

  • BaseCalendarFixture: Class.inherit({...})class BaseCalendarFixture { ... }
  • CalendarFixture / DateBoxFixture: .inherit({ctor: function(){...}})class X extends BaseCalendarFixture with proper constructor
  • Removed MockMonthView: The class overrode renderHeader/renderBody (wrong method names — the actual implementation uses _renderHeader/_renderBody), and monthViewType was never a recognized option in dxCalendar or dxDateBox, so the mock was never invoked
  • Removed monthViewType from both CalendarFixture and DateBoxFixture constructors (unrecognized option)
  • Removed imports: Class (from core/class), noop (from core/utils/common), and Views (from calendar.views) are no longer needed
  • Global assignments: Replaced $.extend(true, DevExpress.ui, {...}) blocks with direct property assignments to preserve backward compatibility with consumers using DevExpress.ui.testing.*

Before / After

// Before
BaseCalendarFixture: Class.inherit({
    ctor: function(options) { ... },
    dispose: function() { ... }
})

// After
class BaseCalendarFixture {
    constructor(options) { ... }
    dispose() { ... }
}
DevExpress.ui.testing.BaseCalendarFixture = BaseCalendarFixture;
Original prompt

This section details on the original issue you should resolve

<issue_title>Tests: Use ES6 syntax for inheritance in packages/devextreme/testing/helpers/calendarFixtures.js</issue_title>
<issue_description></issue_description>

Comments on the Issue (you are @copilot in this section)

  • Fixes DevExpress/devextreme-private#3584

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: r-farkhutdinov <23283554+r-farkhutdinov@users.noreply.github.com>
Copilot AI changed the title [WIP] Use ES6 syntax for inheritance in calendarFixtures.js Tests: Use ES6 class syntax for inheritance in calendarFixtures.js Mar 3, 2026
@r-farkhutdinov r-farkhutdinov marked this pull request as ready for review March 3, 2026 14:05
Copilot AI review requested due to automatic review settings March 3, 2026 14:05
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors the calendar testing fixtures to use native ES6 class/extends syntax instead of the legacy Class.inherit() pattern, while keeping the fixtures available via the DevExpress.ui.testing.* global namespace for existing tests.

Changes:

  • Replaced Class.inherit()-based fixtures with ES6 classes (BaseCalendarFixture, CalendarFixture, DateBoxFixture).
  • Replaced Views['month'].inherit(...) with an ES6 subclass (MockMonthView).
  • Switched from $.extend(true, DevExpress.ui, { testing: ... }) to direct DevExpress.ui.testing.* assignments.

@r-farkhutdinov
Copy link
Contributor

@copilot fix the notes

…darFixtures

Co-authored-by: r-farkhutdinov <23283554+r-farkhutdinov@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Mar 3, 2026

@copilot fix the notes

Fixed in 62d0c44:

  • Removed MockMonthView entirely — it was overriding renderHeader/renderBody (wrong names; the actual calendar uses _renderHeader/_renderBody) and was never actually invoked since monthViewType is not a recognized option in either dxCalendar or dxDateBox.
  • Removed the monthViewType option from both CalendarFixture and DateBoxFixture constructors.
  • Removed the now-unused Views import.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@r-farkhutdinov r-farkhutdinov merged commit 48d055c into 26_1 Mar 4, 2026
148 of 152 checks passed
@r-farkhutdinov r-farkhutdinov deleted the copilot/update-inheritance-es6-syntax branch March 4, 2026 10:02
r-farkhutdinov added a commit to r-farkhutdinov/DevExtreme that referenced this pull request Mar 4, 2026
…evExpress#32769)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: r-farkhutdinov <23283554+r-farkhutdinov@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants