Skip to content

Commit 99945d1

Browse files
authored
Scheduler: refactor view model output and sorted Index (DevExpress#30763)
Co-authored-by: Vladimir Bushmanov <vladimir.bushmanov@devexpress.com>
1 parent eb9d351 commit 99945d1

52 files changed

Lines changed: 1520 additions & 1020 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
-2.06 KB
Loading
-2.34 KB
Loading
-1.46 KB
Loading

e2e/testcafe-devextreme/tests/scheduler/common/dragAndDrop/outlookDragging/base.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ test('Basic drag-n-drop movements from tooltip in month view', async (t) => {
113113
.ok();
114114

115115
await t
116-
.click(scheduler.collectors.find('1').element)
116+
.click(scheduler.collectors.find('1', 1).element)
117117
.expect(scheduler.appointmentTooltip.isVisible()).ok()
118118
.drag(scheduler.appointmentTooltip.getListItem('Appointment 4').element, 320, 150)
119119
.expect(await takeScreenshot('drag-n-drop-\'Appointment 4\'-from-tooltip-in-month.png', scheduler.workSpace))

e2e/testcafe-devextreme/tests/scheduler/common/rerenderOnResize.ts

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ fixture.disablePageReloads`Re-render on resize`
88
.page(url(__dirname, '../../container.html'));
99

1010
const createScheduler = async (container, options?): Promise<void> => createWidget('dxScheduler', {
11-
...options,
1211
currentDate: new Date(2020, 8, 7),
1312
startDayHour: 8,
1413
endDayHour: 20,
@@ -27,24 +26,34 @@ const createScheduler = async (container, options?): Promise<void> => createWidg
2726
endDate: new Date(2020, 8, 7, 9),
2827
text: 'test',
2928
}],
29+
...options,
3030
}, container);
3131

32-
safeSizeTest('Appointment should re-rendered on window resize when width and height not set (T1139566)', async (t) => {
32+
safeSizeTest('Appointment should re-rendered on window resize-up (T1139566)', async (t) => {
33+
const scheduler = new Scheduler('#container');
34+
const { element } = scheduler.getAppointment('test');
35+
36+
await setStyleAttribute(element, 'background-color: red;');
37+
await t.resizeWindow(800, 400);
38+
await t.expect(await getStyleAttribute(element)).match(/transform: translate\(0px, 0px\); width: 10\d\.\d\d\dpx; height: 50px;/);
39+
}, [400, 400]).before(async () => createScheduler('#container', { currentView: 'workWeek' }));
40+
41+
safeSizeTest('Appointment should not re-rendered on window resize when width and height not set (T1139566)', async (t) => {
3342
const scheduler = new Scheduler('#container');
3443
const { element } = scheduler.getAppointment('test');
3544

3645
await setStyleAttribute(element, 'background-color: red;');
3746
await t.resizeWindow(300, 300);
38-
await t.expect(await getStyleAttribute(element)).eql('transform: translate(0px, 26px); width: 200px; height: 74px;');
47+
await t.expect(await getStyleAttribute(element)).eql('transform: translate(0px, 26px); width: 200px; height: 74px; background-color: red;');
3948
}).before(async () => createScheduler('#container'));
4049

41-
safeSizeTest('Appointment should re-rendered on window resize when width and height have percent value (T1139566)', async (t) => {
50+
safeSizeTest('Appointment should not re-rendered on window resize when width and height have percent value (T1139566)', async (t) => {
4251
const scheduler = new Scheduler('#container');
4352
const { element } = scheduler.getAppointment('test');
4453

4554
await setStyleAttribute(element, 'background-color: red;');
4655
await t.resizeWindow(300, 400);
47-
await t.expect(await getStyleAttribute(element)).eql('transform: translate(0px, 26px); width: 200px; height: 74px;');
56+
await t.expect(await getStyleAttribute(element)).eql('transform: translate(0px, 26px); width: 200px; height: 74px; background-color: red;');
4857
}).before(async () => createScheduler('#container', { width: '100%', height: '100%' }));
4958

5059
safeSizeTest('Appointment should not re-rendered on window resize when width and height have static value (T1139566)', async (t) => {
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import {
2+
describe, expect, it,
3+
} from '@jest/globals';
4+
5+
import { createScheduler } from './__mock__/create_scheduler';
6+
import { setupSchedulerTestEnvironment } from './__mock__/m_mock_scheduler';
7+
8+
describe('Appointments', () => {
9+
it('All-day appointment should not be resizable if current view is "day"', async () => {
10+
setupSchedulerTestEnvironment();
11+
const { container } = await createScheduler({
12+
dataSource: [{
13+
text: 'Appointment 1',
14+
startDate: new Date(2015, 1, 9, 8),
15+
endDate: new Date(2015, 1, 9, 9),
16+
allDay: true,
17+
}],
18+
currentView: 'day',
19+
currentDate: new Date(2015, 1, 9, 8),
20+
});
21+
22+
const appointment = container.querySelector('.dx-scheduler-appointment');
23+
expect(appointment && !appointment.classList.contains('dx-resizable')).toBe(true);
24+
});
25+
});

0 commit comments

Comments
 (0)