forked from DevExpress/DevExtreme
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
T1205597: Scheduler - Timetable becomes empty when scrolling to the f…
…ar right in virtual scrolling mode (DevExpress#26743) (DevExpress#26894)
- Loading branch information
Showing
13 changed files
with
136 additions
and
17 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Binary file added
BIN
+116 KB
.../virtualScrolling/etalons/virtual-scrolling-many-cells-month-horizontal-end.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+118 KB
...rtualScrolling/etalons/virtual-scrolling-many-cells-month-horizontal-middle.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+114 KB
...irtualScrolling/etalons/virtual-scrolling-many-cells-month-horizontal-start.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+44.4 KB
...r/virtualScrolling/etalons/virtual-scrolling-many-cells-week-horizontal-end.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+46.9 KB
...irtualScrolling/etalons/virtual-scrolling-many-cells-week-horizontal-middle.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+43.3 KB
...virtualScrolling/etalons/virtual-scrolling-many-cells-week-horizontal-start.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+46.1 KB
...rtualScrolling/etalons/virtual-scrolling-many-cells-workWeek-horizontal-end.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+48.2 KB
...alScrolling/etalons/virtual-scrolling-many-cells-workWeek-horizontal-middle.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+44.8 KB
...ualScrolling/etalons/virtual-scrolling-many-cells-workWeek-horizontal-start.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
106 changes: 106 additions & 0 deletions
106
packages/devextreme/testing/testcafe/tests/scheduler/virtualScrolling/many-cells.ts
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
import { createScreenshotsComparer } from 'devextreme-screenshot-comparer'; | ||
|
||
import { createWidget } from '../../../helpers/createWidget'; | ||
import url from '../../../helpers/getPageUrl'; | ||
import Scheduler from '../../../model/scheduler'; | ||
import { generateOptionMatrix } from '../../../helpers/generateOptionMatrix'; | ||
import type { ViewType } from '../../../../../js/ui/scheduler'; | ||
|
||
fixture.disablePageReloads`Scheduler: Virtual scrolling (many cells)` | ||
.page(url(__dirname, '../../container.html')); | ||
|
||
const buildScreenshotName = (viewType: ViewType, step: string) => `virtual-scrolling-many-cells-${viewType}-horizontal-${step}.png`; | ||
|
||
const testCases = generateOptionMatrix({ | ||
views: [ | ||
[ | ||
{ | ||
type: 'month' as ViewType, | ||
groupOrientation: 'horizontal', | ||
}, | ||
], | ||
[ | ||
{ | ||
type: 'week' as ViewType, | ||
groupOrientation: 'horizontal', | ||
}, | ||
], | ||
[ | ||
{ | ||
type: 'workWeek' as ViewType, | ||
groupOrientation: 'horizontal', | ||
}, | ||
], | ||
], | ||
}); | ||
|
||
testCases.forEach(({ views }) => { | ||
const viewType = views[0].type; | ||
const resourceCount = 400; | ||
|
||
test(`it should correctly render virtual table if more than 1000 cells are virtualized for ${viewType} view (T1205597)`, async (t) => { | ||
const scheduler = new Scheduler('#container'); | ||
|
||
const { takeScreenshot, compareResults } = createScreenshotsComparer(t); | ||
|
||
await t | ||
.expect(await takeScreenshot(buildScreenshotName(viewType, 'start'), scheduler.element)) | ||
.ok(); | ||
|
||
await scheduler.scrollTo(new Date(2024, 1, 1, 1), { groupId: resourceCount / 2 }); | ||
|
||
await t | ||
.expect(await takeScreenshot(buildScreenshotName(viewType, 'middle'), scheduler.element)) | ||
.ok(); | ||
|
||
await scheduler.scrollTo(new Date(2024, 1, 1, 1), { groupId: resourceCount - 1 }); | ||
|
||
await t | ||
.expect(await takeScreenshot(buildScreenshotName(viewType, 'end'), scheduler.element)) | ||
.ok(); | ||
|
||
await t | ||
.expect(compareResults.isValid()) | ||
.ok(compareResults.errorMessages()); | ||
}).before(async () => { | ||
const resources = Array.from({ length: resourceCount }, (_, i) => ({ | ||
id: i, | ||
text: `Resource ${i}`, | ||
})); | ||
|
||
const appointmentDateInfo = Array.from({ length: 29 }) | ||
.map((_, i) => ({ | ||
startDate: new Date(2024, 1, i + 1, 1), | ||
endDate: new Date(2024, 1, i + 1, 4), | ||
})); | ||
|
||
const appointments = Array.from({ length: resourceCount }) | ||
.map((_, resourceIndex) => appointmentDateInfo.map(({ startDate, endDate }) => ({ | ||
text: `Appointment for Resource ${resourceIndex}`, | ||
startDate, | ||
endDate, | ||
groupId: resourceIndex, | ||
}))) | ||
.flat(); | ||
|
||
await createWidget( | ||
'dxScheduler', | ||
{ | ||
height: 600, | ||
currentDate: new Date(2024, 1, 1), | ||
dataSource: appointments, | ||
views, | ||
currentView: viewType, | ||
scrolling: { | ||
mode: 'virtual', | ||
}, | ||
groups: ['groupId'], | ||
resources: [{ | ||
fieldExpr: 'groupId', | ||
dataSource: resources, | ||
label: 'Group', | ||
}], | ||
}, | ||
); | ||
}); | ||
}); |