Scheduler - Fix unstable tests - QUnit - integration.dstAppointments.tests.js#32643
Draft
aleksei-semikozov wants to merge 3 commits intoDevExpress:26_1from
Draft
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes unstable QUnit tests for DST (Daylight Saving Time) appointments in the Scheduler component by unskipping previously skipped test modules and updating them with proper test patterns to ensure stability.
Changes:
- Unskipped two test modules by changing
QUnit.skiptoQUnit.module - Added
legacyForm: trueconfiguration to tests that verify appointment form behavior - Implemented fake timer pattern for appointment clicks to prevent timing issues
- Removed several tests that checked appointment rendering positions (likely unstable)
- Updated assertions to expect appointment timezone times instead of converted scheduler timezone times (matching legacyForm behavior)
- Removed unused
timeZoneUtilsimport - Removed one complete test about recurrence exception deletion behavior
Comments suppressed due to low confidence (1)
packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/integration.dstAppointments.tests.js:360
- The assertion message 'Appointment was deleted' is misleading. This test verifies that a recurrence exception is not rendered after timezone adjustment, not that an appointment was deleted. The test doesn't perform any delete action. Consider changing the message to something like 'exception is not rendered' or 'correct number of events after timezone change' to accurately reflect what the test is verifying.
assert.equal(scheduler.appointments.getAppointmentCount(), 0, 'Appointment was deleted');
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (2)
packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/integration.dstAppointments.tests.js:35
- Stubbing
Date.prototype.getTimezoneOffsetin the module hook is a very broad change that can impact unrelated Date logic inside the Scheduler, Sinon fake timers, and other helpers. In this codebase, timezone-dependent tests typically stubtimeZoneUtils.getClientTimezoneOffset(and/or othertimeZoneUtilshelpers) instead of modifyingDate.prototypedirectly (e.g.testing/tests/DevExpress.ui.widgets.scheduler/timezones.tests.jsstubsgetClientTimezoneOffset). Consider replacing theDate.prototypestub with atimeZoneUtils.getClientTimezoneOffsetstub (or limiting the stub to the specific helper under test) to reduce side effects and keep the approach consistent with existing tests.
this.tzStub = sinon.stub(timeZoneUtils, 'getDiffBetweenClientTimezoneOffsets').returns(0);
// Stub getTimezoneOffset to return 0 (UTC) to avoid CI timezone affecting Date operations
this.timezoneOffsetStub = sinon.stub(Date.prototype, 'getTimezoneOffset').returns(0);
},
packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/integration.dstAppointments.tests.js:382
- The final assertion message is misleading here: the test verifies that no occurrences are rendered due to
recurrenceException, but the message says "Appointment was deleted". Updating the assertion text to describe the expected behavior (no appointment rendered because the occurrence is excluded) will make failures easier to diagnose.
assert.equal(scheduler.appointments.getAppointmentCount(), 0, 'Appointment was deleted');
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.