Skip to content

Commit 10f4cf4

Browse files
authored
Scheduler: fix days duplication in workspace (T1252028) (#30427)
Co-authored-by: Vladimir Bushmanov <[email protected]>
1 parent b5c4cb6 commit 10f4cf4

31 files changed

+1066
-238
lines changed

packages/devextreme/jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/** @type {import('ts-jest').JestConfigWithTsJest} **/
22
module.exports = {
3-
testEnvironment: 'jsdom',
3+
testEnvironment: '<rootDir>/jsdom-with-timezone.js',
44
roots: ['<rootDir>/js'],
55
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
66
moduleNameMapper: {
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import { jest } from '@jest/globals';
2+
import DOMComponent from '@ts/core/widget/dom_component';
3+
4+
import SchedulerWorkSpace from '../../workspaces/m_work_space';
5+
6+
export const setupSchedulerTestEnvironment = ({
7+
cellWidth,
8+
cellHeight,
9+
} = {
10+
cellWidth: 250,
11+
cellHeight: 80,
12+
}): void => {
13+
(DOMComponent.prototype as any)._isVisible = jest.fn().mockReturnValue(true);
14+
SchedulerWorkSpace.prototype._createCrossScrollingConfig = () => ({
15+
direction: 'both',
16+
onScroll: jest.fn(),
17+
onEnd: jest.fn(),
18+
});
19+
Element.prototype.getBoundingClientRect = jest.fn(() => ({
20+
width: cellWidth,
21+
height: cellHeight,
22+
top: 0,
23+
left: 0,
24+
bottom: cellHeight,
25+
right: cellWidth,
26+
x: 0,
27+
y: 0,
28+
toJSON: (): void => {},
29+
}));
30+
};

0 commit comments

Comments
 (0)