diff --git a/packages/devextreme-angular/src/server/render.ts b/packages/devextreme-angular/src/server/render.ts
index 272acefd5cc9..1ea7b55f70ce 100644
--- a/packages/devextreme-angular/src/server/render.ts
+++ b/packages/devextreme-angular/src/server/render.ts
@@ -25,6 +25,9 @@ export class DxServerModule {
temp.innerHTML = renderToString(el);
const mainElement = temp.childNodes[0];
+ if (!mainElement) {
+ return;
+ }
const childString = mainElement.innerHTML;
for (let i = 0; i < mainElement.attributes.length; i++) {
diff --git a/packages/devextreme-angular/tests/src/ui/form.spec.ts b/packages/devextreme-angular/tests/src/ui/form.spec.ts
index 55f12020467c..5087fb53322f 100644
--- a/packages/devextreme-angular/tests/src/ui/form.spec.ts
+++ b/packages/devextreme-angular/tests/src/ui/form.spec.ts
@@ -64,6 +64,7 @@ describe('DxForm', () => {
formGroupItemType: 'itemType="group"',
formValidationItem: 'dxi-validation-rule',
formValidationRequiredItemType: 'type="required"',
+ formCustomValidationItem: 'dxi-validation-rule',
formValidationCustomItemType: 'type="custom"',
},
{
@@ -73,6 +74,7 @@ describe('DxForm', () => {
formGroupItemType: '',
formValidationItem: 'dxi-form-required-rule',
formValidationRequiredItemType: '',
+ formCustomValidationItem: 'dxi-form-custom-rule',
formValidationCustomItemType: '',
},
].forEach(({
@@ -82,6 +84,7 @@ describe('DxForm', () => {
formGroupItemType,
formValidationItem,
formValidationRequiredItemType,
+ formCustomValidationItem,
formValidationCustomItemType,
}) => {
it(`should be able to accept items via nested dxi components (T459714) (with ${testName} nested items)`, () => {
@@ -178,8 +181,8 @@ describe('DxForm', () => {
| ')
- .addClass(this.getHeaderPanelCellClass(panelCellIndex))
- .attr('title', text);
-
- if (cellTemplate?.render) {
- templateCallbacks.push(cellTemplate.render.bind(cellTemplate, {
- model: {
- text,
- date,
- ...this.getGroupsForDateHeaderTemplate(templateIndex),
- },
- index: templateIndex,
- container: getPublicElement($cell),
- }));
- } else {
- $cell.text(text);
- }
-
- container.append($cell);
- return $cell;
- }
-
protected getGroupsForDateHeaderTemplate(templateIndex, indexMultiplier = 1) {
if (this._isHorizontalGroupedWorkSpace() && !this.isGroupedByDate()) {
const groupIndex = this.getGroupIndex(0, templateIndex * indexMultiplier);
@@ -3148,147 +2957,9 @@ class SchedulerWorkSpace extends Widget ').appendTo(element).dxButton({
@@ -1836,7 +1819,7 @@ module('CellTemplate tests', moduleConfig, () => {
}
});
});
- });
+ }
});
module('Time Cell template', {}, function() {
@@ -1998,7 +1981,7 @@ module('CellTemplate tests', moduleConfig, () => {
endDayHour: 1,
cellDuration: 60,
currentDate: new Date(2020, 7, 23),
- renovateRender: true,
+
timeCellTemplate: (data, index) => {
templateOptions.push({ data, index });
},
@@ -2026,7 +2009,7 @@ module('CellTemplate tests', moduleConfig, () => {
endDayHour: 1,
cellDuration: 60,
currentDate: new Date(2020, 7, 23),
- renovateRender: true,
+
timeCellTemplate: (data, index) => {
templateOptions.push({ ...data, index });
},
@@ -2060,7 +2043,7 @@ module('CellTemplate tests', moduleConfig, () => {
endDayHour: 1,
cellDuration: 60,
currentDate: new Date(2020, 7, 23),
- renovateRender: true,
+
timeCellTemplate: (data, index) => {
templateOptions.push({ ...data, index });
},
@@ -2104,14 +2087,10 @@ module('CellTemplate tests', moduleConfig, () => {
});
});
- [true, false].forEach((renovateRender) => {
- const description = renovateRender
- ? 'Renovated Render'
- : 'Old Render';
-
- const baseConfig = getBaseConfig(renovateRender);
+ {
+ const baseConfig = getBaseConfig();
- module(description, {}, () => {
+ module('Time Cell template groups', {}, () => {
[
{
description: '"groups" and "groupIndex" should be correct in timeCellTemplate',
@@ -2242,7 +2221,7 @@ module('CellTemplate tests', moduleConfig, () => {
}
});
});
- });
+ }
});
module('Template Change', () => {
diff --git a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/views.renovation.tests.js b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/views.renovation.tests.js
index 8eed78f82e87..fd00e91eacdc 100644
--- a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/views.renovation.tests.js
+++ b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/views.renovation.tests.js
@@ -27,7 +27,7 @@ module('Renovated Views', () => {
dataSource: [{ id: 1, text: '1' }, { id: 2, text: '2' }],
}],
currentDate: new Date(2021, 1, 20),
- renovateRender: true,
+
});
assert.equal(scheduler.workSpace.groups.getGroupHeaders().length, 2, 'Correct number of group headers');
@@ -45,7 +45,7 @@ module('Renovated Views', () => {
views: [currentView],
currentDate: new Date(2020, 1, 20),
shadeUntilCurrentTime: true,
- renovateRender: true,
+
});
let shader = scheduler.workSpace.getShader();
@@ -68,7 +68,7 @@ module('Renovated Views', () => {
currentView: 'week',
width: 500,
height: 500,
- renovateRender: true,
+
});
let virtualCells = scheduler.workSpace.getVirtualCells();
@@ -94,7 +94,7 @@ module('Renovated Views', () => {
views: [view],
currentView: view,
showAllDayPanel: false,
- renovateRender: true,
+
});
scheduler.instance.option('showAllDayPanel', true);
@@ -110,7 +110,7 @@ module('Renovated Views', () => {
views: [view],
currentView: view,
crossScrollingEnabled: true,
- renovateRender: true,
+
height: 600,
currentDate: new Date(2020, 0, 1),
});
diff --git a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/workSpace.day.tests.js b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/workSpace.day.tests.js
index d70c4ab0ec96..ff8b429828d3 100644
--- a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/workSpace.day.tests.js
+++ b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/workSpace.day.tests.js
@@ -194,14 +194,12 @@ module('Work Space Day', {
assert.deepEqual(this.instance.getDateRange(), [new Date(2015, 2, 16, 0, 0), new Date(2015, 2, 16, 23, 59)], 'Range is OK');
});
- test('Each cell should contain jQuery dxCellData', async function(assert) {
- this.instance.option('renovateRender', false);
-
+ test('Each cell should contain correct cellData', async function(assert) {
this.instance.option('currentDate', new Date(2015, 2, 16));
const $cell = this.instance.$element().find('.' + CELL_CLASS).first();
- assert.deepEqual($cell.data('dxCellData'), {
+ assert.deepEqual(this.instance.getCellData($cell), {
startDate: new Date(2015, 2, 16, 0, 0),
endDate: new Date(2015, 2, 16, 0, 30),
allDay: false,
@@ -209,20 +207,16 @@ module('Work Space Day', {
});
});
- test('dxCellData should be \'immutable\'', function(assert) {
- this.instance.option('renovateRender', false);
-
+ test('cellData should be \'immutable\'', function(assert) {
const $element = this.instance.$element();
const $cell = $element.find('.' + CELL_CLASS).first();
const cellData = this.instance.getCellData($cell);
cellData.cellCustomField = 'cell-custom-data';
- assert.strictEqual($element.find('.' + CELL_CLASS).first().data('dxCellData').cellCustomField, undefined, 'Cell data is not affected');
+ assert.strictEqual(this.instance.getCellData($element.find('.' + CELL_CLASS).first()).cellCustomField, undefined, 'Cell data is not affected');
});
test('Cells have right cellData in vertical grouped WorkSpace Day view', async function(assert) {
- this.instance.option('renovateRender', false);
-
await applyWorkspaceGroups(this.instance, [{
label: 'one',
fieldExpr: 'one',
@@ -234,8 +228,8 @@ module('Work Space Day', {
startDayHour: 9,
showAllDayPanel: false
});
- const firstCellData = this.instance.$element().find('.dx-scheduler-date-table-cell').eq(0).data('dxCellData');
- const secondCellData = this.instance.$element().find('.dx-scheduler-date-table-cell').eq(36).data('dxCellData');
+ const firstCellData = this.instance.getCellData(this.instance.$element().find('.dx-scheduler-date-table-cell').eq(0));
+ const secondCellData = this.instance.getCellData(this.instance.$element().find('.dx-scheduler-date-table-cell').eq(36));
assert.deepEqual(firstCellData.startDate, new Date(2018, 2, 16, 9), 'cell has right startDate');
assert.deepEqual(firstCellData.endDate, new Date(2018, 2, 16, 9, 30), 'cell has right endDate');
@@ -284,12 +278,10 @@ module('Work Space Day with grouping by date', () => {
});
test('Date table cells shoud have right cellData, groupByDate = true', async function(assert) {
- this.instance.option('renovateRender', false);
-
this.instance.option('intervalCount', 3);
const $cells = this.instance.$element().find('.dx-scheduler-date-table-cell');
- assert.deepEqual($cells.eq(0).data('dxCellData'), {
+ assert.deepEqual(this.instance.getCellData($cells.eq(0)), {
startDate: new Date(2018, 2, 1),
endDate: new Date(2018, 2, 1, 0, 30),
allDay: false,
@@ -299,7 +291,7 @@ module('Work Space Day with grouping by date', () => {
groupIndex: 0,
});
- assert.deepEqual($cells.eq(1).data('dxCellData'), {
+ assert.deepEqual(this.instance.getCellData($cells.eq(1)), {
startDate: new Date(2018, 2, 1),
endDate: new Date(2018, 2, 1, 0, 30),
allDay: false,
@@ -309,7 +301,7 @@ module('Work Space Day with grouping by date', () => {
groupIndex: 1,
});
- assert.deepEqual($cells.eq(2).data('dxCellData'), {
+ assert.deepEqual(this.instance.getCellData($cells.eq(2)), {
startDate: new Date(2018, 2, 2),
endDate: new Date(2018, 2, 2, 0, 30),
allDay: false,
@@ -319,7 +311,7 @@ module('Work Space Day with grouping by date', () => {
groupIndex: 0,
});
- assert.deepEqual($cells.eq(3).data('dxCellData'), {
+ assert.deepEqual(this.instance.getCellData($cells.eq(3)), {
startDate: new Date(2018, 2, 2),
endDate: new Date(2018, 2, 2, 0, 30),
allDay: false,
@@ -329,7 +321,7 @@ module('Work Space Day with grouping by date', () => {
groupIndex: 1,
});
- assert.deepEqual($cells.eq(4).data('dxCellData'), {
+ assert.deepEqual(this.instance.getCellData($cells.eq(4)), {
startDate: new Date(2018, 2, 3),
endDate: new Date(2018, 2, 3, 0, 30),
allDay: false,
@@ -339,7 +331,7 @@ module('Work Space Day with grouping by date', () => {
groupIndex: 0,
});
- assert.deepEqual($cells.eq(5).data('dxCellData'), {
+ assert.deepEqual(this.instance.getCellData($cells.eq(5)), {
startDate: new Date(2018, 2, 3),
endDate: new Date(2018, 2, 3, 0, 30),
allDay: false,
@@ -351,34 +343,32 @@ module('Work Space Day with grouping by date', () => {
});
test('Date table cells should have right cellData, groupByDate = true without groups', async function(assert) {
- this.instance.option('renovateRender', false);
-
this.instance.option('getResourceManager', getEmptyResourceManager);
this.instance.option('groups', []);
const $cells = this.instance.$element().find('.dx-scheduler-date-table-cell');
- assert.deepEqual($cells.eq(0).data('dxCellData'), {
+ assert.deepEqual(this.instance.getCellData($cells.eq(0)), {
startDate: new Date(2018, 2, 1),
endDate: new Date(2018, 2, 1, 0, 30),
allDay: false,
groupIndex: 0,
});
- assert.deepEqual($cells.eq(1).data('dxCellData'), {
+ assert.deepEqual(this.instance.getCellData($cells.eq(1)), {
startDate: new Date(2018, 2, 2),
endDate: new Date(2018, 2, 2, 0, 30),
allDay: false,
groupIndex: 0,
});
- assert.deepEqual($cells.eq(2).data('dxCellData'), {
+ assert.deepEqual(this.instance.getCellData($cells.eq(2)), {
startDate: new Date(2018, 2, 1, 0, 30),
endDate: new Date(2018, 2, 1, 1, 0),
allDay: false,
groupIndex: 0,
});
- assert.deepEqual($cells.eq(3).data('dxCellData'), {
+ assert.deepEqual(this.instance.getCellData($cells.eq(3)), {
startDate: new Date(2018, 2, 2, 0, 30),
endDate: new Date(2018, 2, 2, 1, 0),
allDay: false,
@@ -443,11 +433,10 @@ module('Work Space Day with grouping by date', () => {
this.createInstance({
intervalCount: 2,
currentDate: new Date(2017, 5, 29),
- renovateRender: false,
});
- const firstCellData = this.instance.$element().find('.dx-scheduler-date-table-cell').eq(1).data('dxCellData');
- const secondCellData = this.instance.$element().find('.dx-scheduler-date-table-cell').eq(95).data('dxCellData');
+ const firstCellData = this.instance.getCellData(this.instance.$element().find('.dx-scheduler-date-table-cell').eq(1));
+ const secondCellData = this.instance.getCellData(this.instance.$element().find('.dx-scheduler-date-table-cell').eq(95));
assert.deepEqual(firstCellData.startDate, new Date(2017, 5, 30, 0), 'cell has right startDate');
assert.deepEqual(firstCellData.endDate, new Date(2017, 5, 30, 0, 30), 'cell has right endtDate');
@@ -461,11 +450,10 @@ module('Work Space Day with grouping by date', () => {
intervalCount: 3,
currentDate: new Date(2017, 5, 28),
startDate: new Date(2017, 5, 21),
- renovateRender: false,
});
- const firstCellData = this.instance.$element().find('.dx-scheduler-date-table-cell').eq(0).data('dxCellData');
- const secondCellData = this.instance.$element().find('.dx-scheduler-date-table-cell').eq(143).data('dxCellData');
+ const firstCellData = this.instance.getCellData(this.instance.$element().find('.dx-scheduler-date-table-cell').eq(0));
+ const secondCellData = this.instance.getCellData(this.instance.$element().find('.dx-scheduler-date-table-cell').eq(143));
assert.deepEqual(firstCellData.startDate, new Date(2017, 5, 27, 0), 'cell has right startDate');
assert.deepEqual(firstCellData.endDate, new Date(2017, 5, 27, 0, 30), 'cell has right endtDate');
@@ -479,11 +467,10 @@ module('Work Space Day with grouping by date', () => {
intervalCount: 3,
currentDate: new Date(2017, 5, 25),
startDate: new Date(2017, 5, 30),
- renovateRender: false,
});
- const firstCellData = this.instance.$element().find('.dx-scheduler-date-table-cell').eq(0).data('dxCellData');
- const secondCellData = this.instance.$element().find('.dx-scheduler-date-table-cell').eq(143).data('dxCellData');
+ const firstCellData = this.instance.getCellData(this.instance.$element().find('.dx-scheduler-date-table-cell').eq(0));
+ const secondCellData = this.instance.getCellData(this.instance.$element().find('.dx-scheduler-date-table-cell').eq(143));
assert.deepEqual(firstCellData.startDate, new Date(2017, 5, 24, 0), 'cell has right startDate');
assert.deepEqual(firstCellData.endDate, new Date(2017, 5, 24, 0, 30), 'cell has right endtDate');
diff --git a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/workSpace.markup-1.tests.js b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/workSpace.markup-1.tests.js
index 70d5ba7d38e8..b0bc1e8cc45f 100644
--- a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/workSpace.markup-1.tests.js
+++ b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/workSpace.markup-1.tests.js
@@ -142,9 +142,7 @@ QUnit.module('Workspace Day markup', dayModuleConfig, () => {
assert.equal(cellCounter, 48, 'Each row has a two cells');
});
- QUnit.test('Grouped cells should have a right group field in dxCellData', async function(assert) {
- this.instance.option('renovateRender', false);
-
+ QUnit.test('Grouped cells should have a right group field in cellData', async function(assert) {
const $element = this.instance.$element();
await applyWorkspaceGroups(this.instance, [{
label: 'one',
@@ -152,10 +150,10 @@ QUnit.module('Workspace Day markup', dayModuleConfig, () => {
dataSource: [{ id: 1, text: 'a' }, { id: 2, text: 'b' }]
}]);
- assert.deepEqual($element.find('.dx-scheduler-date-table tbody tr>td').eq(0).data('dxCellData').groups, {
+ assert.deepEqual(this.instance.getCellData($element.find('.dx-scheduler-date-table tbody tr>td').eq(0)).groups, {
one: 1
}, 'Cell group is OK');
- assert.deepEqual($element.find('.dx-scheduler-date-table tbody tr>td').eq(1).data('dxCellData').groups, { one: 2 }, 'Cell group is OK');
+ assert.deepEqual(this.instance.getCellData($element.find('.dx-scheduler-date-table tbody tr>td').eq(1)).groups, { one: 2 }, 'Cell group is OK');
});
QUnit.test('Scheduler workspace day view should not contain a single header', async function(assert) {
@@ -164,27 +162,21 @@ QUnit.module('Workspace Day markup', dayModuleConfig, () => {
assert.equal($element.find('.dx-scheduler-header-row th').length, 0, 'Date table has not header cell');
});
- [true, false].forEach((isRenovatedRender) => {
- QUnit.test('Scheduler workspace day grouped view should contain a few headers', async function(assert) {
- const $element = this.instance.$element();
- await applyWorkspaceGroups(this.instance, [{
- label: 'one',
- fieldExpr: 'one',
- dataSource: [{ id: 1, text: 'a' }, { id: 2, text: 'b' }]
- }, {
- label: 'two',
- fieldExpr: 'two',
- dataSource: [{ id: 1, text: 'c' }, { id: 2, text: 'd' }]
- }]);
- this.instance.option('renovateRender', isRenovatedRender);
-
- const lowerHeaderColspan = this.instance.option('renovateRender')
- ? '1' : undefined;
-
- assert.equal($element.find('.dx-scheduler-header-row th').length, 0, 'Date table has not header cell');
- assert.equal($element.find('.dx-scheduler-group-row').eq(0).find('th').attr('colspan'), '2', 'Group header has a right \'colspan\'');
- assert.strictEqual($element.find('.dx-scheduler-group-row').eq(1).find('th').attr('colspan'), lowerHeaderColspan, 'Group header has a right \'colspan\'');
- });
+ QUnit.test('Scheduler workspace day grouped view should contain a few headers', async function(assert) {
+ const $element = this.instance.$element();
+ await applyWorkspaceGroups(this.instance, [{
+ label: 'one',
+ fieldExpr: 'one',
+ dataSource: [{ id: 1, text: 'a' }, { id: 2, text: 'b' }]
+ }, {
+ label: 'two',
+ fieldExpr: 'two',
+ dataSource: [{ id: 1, text: 'c' }, { id: 2, text: 'd' }]
+ }]);
+
+ assert.equal($element.find('.dx-scheduler-header-row th').length, 0, 'Date table has not header cell');
+ assert.equal($element.find('.dx-scheduler-group-row').eq(0).find('th').attr('colspan'), '2', 'Group header has a right \'colspan\'');
+ assert.strictEqual($element.find('.dx-scheduler-group-row').eq(1).find('th').attr('colspan'), '1', 'Group header has a right \'colspan\'');
});
QUnit.test('Time panel should have 24 rows and 24 cells', async function(assert) {
@@ -322,26 +314,22 @@ QUnit.module('Workspace Day markup with vertical grouping', dayWithGroupingModul
assert.equal($element.find('.dx-scheduler-time-panel-cell').length, cellCount, 'Time panel has a right count of cells');
});
- QUnit.test('Grouped cells should have a right group field in dxCellData', async function(assert) {
- this.instance.option('renovateRender', false);
-
+ QUnit.test('Grouped cells should have a right group field in cellData', async function(assert) {
const $element = this.instance.$element();
- assert.deepEqual($element.find('.dx-scheduler-date-table tbody tr>td').eq(0).data('dxCellData').groups, {
+ assert.deepEqual(this.instance.getCellData($element.find('.dx-scheduler-date-table tbody tr>td').eq(0)).groups, {
a: 1
}, 'Cell group is OK');
- assert.deepEqual($element.find('.dx-scheduler-date-table tbody tr>td').eq(25).data('dxCellData').groups, { a: 2 }, 'Cell group is OK');
+ assert.deepEqual(this.instance.getCellData($element.find('.dx-scheduler-date-table tbody tr>td').eq(25)).groups, { a: 2 }, 'Cell group is OK');
});
- QUnit.test('Grouped allDay cells should have a right group field in dxCellData', async function(assert) {
- this.instance.option('renovateRender', false);
-
+ QUnit.test('Grouped allDay cells should have a right group field in cellData', async function(assert) {
this.instance.option('showAllDayPanel', true);
const $allDayCells = this.instance.$element().find(`.${ALL_DAY_TABLE_CELL_CLASS}`);
- assert.deepEqual($allDayCells.eq(0).data('dxCellData').groups, { a: 1 }, 'Cell group is OK');
- assert.deepEqual($allDayCells.eq(1).data('dxCellData').groups, { a: 2 }, 'Cell group is OK');
+ assert.deepEqual(this.instance.getCellData($allDayCells.eq(0)).groups, { a: 1 }, 'Cell group is OK');
+ assert.deepEqual(this.instance.getCellData($allDayCells.eq(1)).groups, { a: 2 }, 'Cell group is OK');
});
});
@@ -570,17 +558,15 @@ QUnit.module('Workspace Week markup with vertical grouping', weekWithGroupingMod
checkRowsAndCells(this.instance.$element(), assert, 0.5, 8, 20, 2);
});
- QUnit.test('Grouped cells should have a right group field in dxCellData', async function(assert) {
- this.instance.option('renovateRender', false);
-
+ QUnit.test('Grouped cells should have a right group field in cellData', async function(assert) {
const $element = this.instance.$element();
const $cells = $element.find('.dx-scheduler-date-table tbody tr>td');
const cellCount = $cells.length;
- assert.deepEqual($cells.eq(0).data('dxCellData').groups, {
+ assert.deepEqual(this.instance.getCellData($cells.eq(0)).groups, {
a: 1
}, 'Cell group is OK');
- assert.deepEqual($cells.eq(cellCount / 2).data('dxCellData').groups, { a: 2 }, 'Cell group is OK');
+ assert.deepEqual(this.instance.getCellData($cells.eq(cellCount / 2)).groups, { a: 2 }, 'Cell group is OK');
});
});
@@ -1123,17 +1109,15 @@ QUnit.module('Workspace Month markup with vertical grouping', monthWithGroupingM
assert.equal(cellCounter, 12, 'Each row has a 7 cells');
});
- QUnit.test('Grouped cells should have a right group field in dxCellData', async function(assert) {
- this.instance.option('renovateRender', false);
-
+ QUnit.test('Grouped cells should have a right group field in cellData', async function(assert) {
const $element = this.instance.$element();
const $cells = $element.find('.dx-scheduler-date-table tbody tr>td');
const cellCount = $cells.length;
- assert.deepEqual($cells.eq(0).data('dxCellData').groups, {
+ assert.deepEqual(this.instance.getCellData($cells.eq(0)).groups, {
a: 1
}, 'Cell group is OK');
- assert.deepEqual($cells.eq(cellCount / 2).data('dxCellData').groups, { a: 2 }, 'Cell group is OK');
+ assert.deepEqual(this.instance.getCellData($cells.eq(cellCount / 2)).groups, { a: 2 }, 'Cell group is OK');
});
QUnit.test('Scheduler workspace month view should have a dates with other-month class', async function(assert) {
@@ -1253,256 +1237,249 @@ QUnit.module('FirstGroupCell and LastGroupCell classes', () => {
}
};
- [true, false].forEach((isRenovatedRender) => {
- const moduleName = isRenovatedRender
- ? 'Renovated Render'
- : 'Non-Renovated Render';
-
- const groupClassesModuleConfig = {
- beforeEach: function() {
- this.createInstance = (workspaceClass, options = {}) => {
- const instance = $('#scheduler-work-space')[workspaceClass]({
- intervalCount: 3,
- renovateRender: isRenovatedRender,
- startDayHour: 0,
- endDayHour: 2,
- currentDate: new Date(2020, 8, 27),
- groupOrientation: 'horizontal',
- getResourceManager: getEmptyResourceManager,
- ...options,
- })[workspaceClass]('instance');
-
- return instance;
- };
- }
- };
-
- QUnit.module(moduleName, groupClassesModuleConfig, () => {
- [{
- view: WORKSPACE_DAY,
- columnCountInGroup: 3,
- rowCountInGroup: 4,
- }, {
- view: WORKSPACE_WEEK,
- columnCountInGroup: 21,
- rowCountInGroup: 4,
- }, {
- view: WORKSPACE_MONTH,
- columnCountInGroup: 7,
- rowCountInGroup: 14,
- }].forEach(({ view, columnCountInGroup, rowCountInGroup }) => {
- QUnit.test(`first-group-cell class should be assigned to correct cells in basic case in ${view.name}`, async function(assert) {
- const instance = this.createInstance(view.class);
-
- instance.$element().find(`.${CELL_CLASS}`).each(function(index) {
- checkFirstGroupCell(assert, this, index, columnCountInGroup, 'Date table');
- });
-
- instance.$element().find(`.${ALL_DAY_TABLE_CELL_CLASS}`).each(function(index) {
- checkFirstGroupCell(assert, this, index, columnCountInGroup, 'All-day panel');
- });
-
- instance.$element().find(`.${TIME_PANEL_CELL_CLASS}`).each(function() {
- assert.notOk($(this).hasClass(FIRST_GROUP_CELL_CLASS), 'Time panel cell does not have first-group class');
- });
+ const groupClassesModuleConfig = {
+ beforeEach: function() {
+ this.createInstance = (workspaceClass, options = {}) => {
+ const instance = $('#scheduler-work-space')[workspaceClass]({
+ intervalCount: 3,
+ startDayHour: 0,
+ endDayHour: 2,
+ currentDate: new Date(2020, 8, 27),
+ groupOrientation: 'horizontal',
+ getResourceManager: getEmptyResourceManager,
+ ...options,
+ })[workspaceClass]('instance');
+
+ return instance;
+ };
+ }
+ };
- instance.$element().find(`.${HEADER_PANEL_CELL_CLASS}`).each(function(index) {
- checkFirstGroupCell(assert, this, index, columnCountInGroup, 'Header panel');
- });
+ QUnit.module('Group cell classes', groupClassesModuleConfig, () => {
+ [{
+ view: WORKSPACE_DAY,
+ columnCountInGroup: 3,
+ rowCountInGroup: 4,
+ }, {
+ view: WORKSPACE_WEEK,
+ columnCountInGroup: 21,
+ rowCountInGroup: 4,
+ }, {
+ view: WORKSPACE_MONTH,
+ columnCountInGroup: 7,
+ rowCountInGroup: 14,
+ }].forEach(({ view, columnCountInGroup, rowCountInGroup }) => {
+ QUnit.test(`first-group-cell class should be assigned to correct cells in basic case in ${view.name}`, async function(assert) {
+ const instance = this.createInstance(view.class);
+
+ instance.$element().find(`.${CELL_CLASS}`).each(function(index) {
+ checkFirstGroupCell(assert, this, index, columnCountInGroup, 'Date table');
});
- QUnit.test(`first-group-cell class should be assigned to correct cells in ${view.name} when appointments are grouped horizontally`, async function(assert) {
- const instance = this.createInstance(view.class);
- await applyWorkspaceGroups(instance, [{
- label: 'one',
- fieldExpr: 'one',
- dataSource: [{ id: 1, text: 'a' }, { id: 2, text: 'b' }],
- }]);
+ instance.$element().find(`.${ALL_DAY_TABLE_CELL_CLASS}`).each(function(index) {
+ checkFirstGroupCell(assert, this, index, columnCountInGroup, 'All-day panel');
+ });
- instance.$element().find(`.${CELL_CLASS}`).each(function(index) {
- checkFirstGroupCell(assert, this, index, columnCountInGroup, 'Date table');
- });
+ instance.$element().find(`.${TIME_PANEL_CELL_CLASS}`).each(function() {
+ assert.notOk($(this).hasClass(FIRST_GROUP_CELL_CLASS), 'Time panel cell does not have first-group class');
+ });
- instance.$element().find(`.${ALL_DAY_TABLE_CELL_CLASS}`).each(function(index) {
- checkFirstGroupCell(assert, this, index, columnCountInGroup, 'All-day panel');
- });
+ instance.$element().find(`.${HEADER_PANEL_CELL_CLASS}`).each(function(index) {
+ checkFirstGroupCell(assert, this, index, columnCountInGroup, 'Header panel');
+ });
+ });
- instance.$element().find(`.${TIME_PANEL_CELL_CLASS}`).each(function() {
- assert.notOk($(this).hasClass(FIRST_GROUP_CELL_CLASS), 'Time panel cell does not have first-group class');
- });
+ QUnit.test(`first-group-cell class should be assigned to correct cells in ${view.name} when appointments are grouped horizontally`, async function(assert) {
+ const instance = this.createInstance(view.class);
+ await applyWorkspaceGroups(instance, [{
+ label: 'one',
+ fieldExpr: 'one',
+ dataSource: [{ id: 1, text: 'a' }, { id: 2, text: 'b' }],
+ }]);
- instance.$element().find(`.${HEADER_PANEL_CELL_CLASS}`).each(function(index) {
- checkFirstGroupCell(assert, this, index, columnCountInGroup, 'Header panel');
- });
+ instance.$element().find(`.${CELL_CLASS}`).each(function(index) {
+ checkFirstGroupCell(assert, this, index, columnCountInGroup, 'Date table');
+ });
+
+ instance.$element().find(`.${ALL_DAY_TABLE_CELL_CLASS}`).each(function(index) {
+ checkFirstGroupCell(assert, this, index, columnCountInGroup, 'All-day panel');
+ });
+
+ instance.$element().find(`.${TIME_PANEL_CELL_CLASS}`).each(function() {
+ assert.notOk($(this).hasClass(FIRST_GROUP_CELL_CLASS), 'Time panel cell does not have first-group class');
+ });
+
+ instance.$element().find(`.${HEADER_PANEL_CELL_CLASS}`).each(function(index) {
+ checkFirstGroupCell(assert, this, index, columnCountInGroup, 'Header panel');
+ });
+ });
+
+ QUnit.test(`first-group-cell class should be assigned to correct cells in ${view.name} when appointments are grouped by date`, async function(assert) {
+ const instance = this.createInstance(view.class, {
+ groupByDate: true,
+ });
+ await applyWorkspaceGroups(instance, [{
+ label: 'one',
+ fieldExpr: 'one',
+ dataSource: [{ id: 1, text: 'a' }, { id: 2, text: 'b' }],
+ }]);
+
+ instance.$element().find(`.${CELL_CLASS}`).each(function(index) {
+ checkFirstGroupCell(assert, this, index, GROUP_COUNT, 'Date table');
});
- QUnit.test(`first-group-cell class should be assigned to correct cells in ${view.name} when appointments are grouped by date`, async function(assert) {
- const instance = this.createInstance(view.class, {
- groupByDate: true,
- });
- await applyWorkspaceGroups(instance, [{
- label: 'one',
- fieldExpr: 'one',
- dataSource: [{ id: 1, text: 'a' }, { id: 2, text: 'b' }],
- }]);
-
- instance.$element().find(`.${CELL_CLASS}`).each(function(index) {
- checkFirstGroupCell(assert, this, index, GROUP_COUNT, 'Date table');
- });
-
- instance.$element().find(`.${ALL_DAY_TABLE_CELL_CLASS}`).each(function(index) {
- checkFirstGroupCell(assert, this, index, GROUP_COUNT, 'All-day panel');
- });
-
- instance.$element().find(`.${TIME_PANEL_CELL_CLASS}`).each(function() {
+ instance.$element().find(`.${ALL_DAY_TABLE_CELL_CLASS}`).each(function(index) {
+ checkFirstGroupCell(assert, this, index, GROUP_COUNT, 'All-day panel');
+ });
+
+ instance.$element().find(`.${TIME_PANEL_CELL_CLASS}`).each(function() {
+ assert.notOk($(this).hasClass(FIRST_GROUP_CELL_CLASS), 'Time panel cell does not have first-group class');
+ });
+
+ instance.$element().find(`.${HEADER_PANEL_CELL_CLASS}`).each(function(index) {
+ assert.ok($(this).hasClass(FIRST_GROUP_CELL_CLASS), 'Header panel cell has first-group class');
+ });
+ });
+
+ QUnit.test(`first-group-cell class should be assigned to correct cells in ${view.name} when appointments are grouped vertically`, async function(assert) {
+ const instance = this.createInstance(view.class, {
+ groupOrientation: 'vertical',
+ });
+ await applyWorkspaceGroups(instance, [{
+ label: 'one',
+ fieldExpr: 'one',
+ dataSource: [{ id: 1, text: 'a' }, { id: 2, text: 'b' }],
+ }]);
+
+ instance.$element().find(`.${CELL_CLASS}`).each(function(index) {
+ if(Math.floor(index / columnCountInGroup) % rowCountInGroup === 0) {
+ assert.ok($(this).hasClass(FIRST_GROUP_CELL_CLASS), 'Date table cell has first-group class');
+ } else {
+ assert.notOk($(this).hasClass(FIRST_GROUP_CELL_CLASS), 'Date table cell does not have first-group class');
+ }
+ });
+
+ instance.$element().find(`.${ALL_DAY_TABLE_CELL_CLASS}`).each(function() {
+ assert.notOk($(this).hasClass(FIRST_GROUP_CELL_CLASS), 'All-day panel cell does not have first-group class');
+ });
+
+ instance.$element().find(`.${TIME_PANEL_CELL_CLASS}`).each(function(index) {
+ if(index % rowCountInGroup === 0) {
+ assert.ok($(this).hasClass(FIRST_GROUP_CELL_CLASS), 'Time panel cell has first-group class');
+ } else {
assert.notOk($(this).hasClass(FIRST_GROUP_CELL_CLASS), 'Time panel cell does not have first-group class');
- });
+ }
+ });
+
+ instance.$element().find(`.${HEADER_PANEL_CELL_CLASS}`).each(function() {
+ assert.notOk($(this).hasClass(FIRST_GROUP_CELL_CLASS), 'Header panel cell does not have first-group class');
+ });
+ });
+
+ QUnit.test(`last-group-cell class should be assigned to correct cells in basic case in ${view.name}`, async function(assert) {
+ const instance = this.createInstance(view.class);
+
+ instance.$element().find(`.${CELL_CLASS}`).each(function(index) {
+ checkLastGroupCell(assert, this, index, columnCountInGroup, 'Date table');
+ });
- instance.$element().find(`.${HEADER_PANEL_CELL_CLASS}`).each(function(index) {
- assert.ok($(this).hasClass(FIRST_GROUP_CELL_CLASS), 'Header panel cell has first-group class');
- });
+ instance.$element().find(`.${ALL_DAY_TABLE_CELL_CLASS}`).each(function(index) {
+ checkLastGroupCell(assert, this, index, columnCountInGroup, 'All-day panel');
});
- QUnit.test(`first-group-cell class should be assigned to correct cells in ${view.name} when appointments are grouped vertically`, async function(assert) {
- const instance = this.createInstance(view.class, {
- groupOrientation: 'vertical',
- });
- await applyWorkspaceGroups(instance, [{
- label: 'one',
- fieldExpr: 'one',
- dataSource: [{ id: 1, text: 'a' }, { id: 2, text: 'b' }],
- }]);
-
- instance.$element().find(`.${CELL_CLASS}`).each(function(index) {
- if(Math.floor(index / columnCountInGroup) % rowCountInGroup === 0) {
- assert.ok($(this).hasClass(FIRST_GROUP_CELL_CLASS), 'Date table cell has first-group class');
- } else {
- assert.notOk($(this).hasClass(FIRST_GROUP_CELL_CLASS), 'Date table cell does not have first-group class');
- }
- });
-
- instance.$element().find(`.${ALL_DAY_TABLE_CELL_CLASS}`).each(function() {
- assert.notOk($(this).hasClass(FIRST_GROUP_CELL_CLASS), 'All-day panel cell does not have first-group class');
- });
-
- instance.$element().find(`.${TIME_PANEL_CELL_CLASS}`).each(function(index) {
- if(index % rowCountInGroup === 0) {
- assert.ok($(this).hasClass(FIRST_GROUP_CELL_CLASS), 'Time panel cell has first-group class');
- } else {
- assert.notOk($(this).hasClass(FIRST_GROUP_CELL_CLASS), 'Time panel cell does not have first-group class');
- }
- });
-
- instance.$element().find(`.${HEADER_PANEL_CELL_CLASS}`).each(function() {
- assert.notOk($(this).hasClass(FIRST_GROUP_CELL_CLASS), 'Header panel cell does not have first-group class');
- });
+ instance.$element().find(`.${TIME_PANEL_CELL_CLASS}`).each(function() {
+ assert.notOk($(this).hasClass(LAST_GROUP_CELL_CLASS), 'Time panel cell does not have last-group class');
});
- QUnit.test(`last-group-cell class should be assigned to correct cells in basic case in ${view.name}`, async function(assert) {
- const instance = this.createInstance(view.class);
+ instance.$element().find(`.${HEADER_PANEL_CELL_CLASS}`).each(function(index) {
+ checkLastGroupCell(assert, this, index, columnCountInGroup, 'Header panel');
+ });
+ });
- instance.$element().find(`.${CELL_CLASS}`).each(function(index) {
- checkLastGroupCell(assert, this, index, columnCountInGroup, 'Date table');
- });
+ QUnit.test(`last-group-cell class should be assigned to correct cells in ${view.name} when appointments are grouped horizontally`, async function(assert) {
+ const instance = this.createInstance(view.class);
+ await applyWorkspaceGroups(instance, [{
+ label: 'one',
+ fieldExpr: 'one',
+ dataSource: [{ id: 1, text: 'a' }, { id: 2, text: 'b' }]
+ }]);
- instance.$element().find(`.${ALL_DAY_TABLE_CELL_CLASS}`).each(function(index) {
- checkLastGroupCell(assert, this, index, columnCountInGroup, 'All-day panel');
- });
+ instance.$element().find(`.${CELL_CLASS}`).each(function(index) {
+ checkLastGroupCell(assert, this, index, columnCountInGroup, 'Date table');
+ });
- instance.$element().find(`.${TIME_PANEL_CELL_CLASS}`).each(function() {
- assert.notOk($(this).hasClass(LAST_GROUP_CELL_CLASS), 'Time panel cell does not have last-group class');
- });
+ instance.$element().find(`.${ALL_DAY_TABLE_CELL_CLASS}`).each(function(index) {
+ checkLastGroupCell(assert, this, index, columnCountInGroup, 'All-day panel');
+ });
- instance.$element().find(`.${HEADER_PANEL_CELL_CLASS}`).each(function(index) {
- checkLastGroupCell(assert, this, index, columnCountInGroup, 'Header panel');
- });
+ instance.$element().find(`.${TIME_PANEL_CELL_CLASS}`).each(function() {
+ assert.notOk($(this).hasClass(LAST_GROUP_CELL_CLASS), 'Time panel cell does not have last-group class');
});
- QUnit.test(`last-group-cell class should be assigned to correct cells in ${view.name} when appointments are grouped horizontally`, async function(assert) {
- const instance = this.createInstance(view.class);
- await applyWorkspaceGroups(instance, [{
- label: 'one',
- fieldExpr: 'one',
- dataSource: [{ id: 1, text: 'a' }, { id: 2, text: 'b' }]
- }]);
+ instance.$element().find(`.${HEADER_PANEL_CELL_CLASS}`).each(function(index) {
+ checkLastGroupCell(assert, this, index, columnCountInGroup, 'Header panel');
+ });
+ });
- instance.$element().find(`.${CELL_CLASS}`).each(function(index) {
- checkLastGroupCell(assert, this, index, columnCountInGroup, 'Date table');
- });
+ QUnit.test(`last-group-cell class should be assigned to correct cells in ${view.name} when appointments are grouped by date`, async function(assert) {
+ const instance = this.createInstance(view.class, {
+ groupByDate: true,
+ });
+ await applyWorkspaceGroups(instance, [{
+ label: 'one',
+ fieldExpr: 'one',
+ dataSource: [{ id: 1, text: 'a' }, { id: 2, text: 'b' }]
+ }]);
+
+ instance.$element().find(`.${CELL_CLASS}`).each(function(index) {
+ checkLastGroupCell(assert, this, index, GROUP_COUNT, 'Date table');
+ });
- instance.$element().find(`.${ALL_DAY_TABLE_CELL_CLASS}`).each(function(index) {
- checkLastGroupCell(assert, this, index, columnCountInGroup, 'All-day panel');
- });
+ instance.$element().find(`.${ALL_DAY_TABLE_CELL_CLASS}`).each(function(index) {
+ checkLastGroupCell(assert, this, index, GROUP_COUNT, 'All-day panel');
+ });
- instance.$element().find(`.${TIME_PANEL_CELL_CLASS}`).each(function() {
- assert.notOk($(this).hasClass(LAST_GROUP_CELL_CLASS), 'Time panel cell does not have last-group class');
- });
+ instance.$element().find(`.${TIME_PANEL_CELL_CLASS}`).each(function() {
+ assert.notOk($(this).hasClass(LAST_GROUP_CELL_CLASS), 'Time panel cell does not have last-group class');
+ });
- instance.$element().find(`.${HEADER_PANEL_CELL_CLASS}`).each(function(index) {
- checkLastGroupCell(assert, this, index, columnCountInGroup, 'Header panel');
- });
+ instance.$element().find(`.${HEADER_PANEL_CELL_CLASS}`).each(function() {
+ assert.ok($(this).hasClass(LAST_GROUP_CELL_CLASS), 'Header panel cell has last-group class');
});
+ });
- QUnit.test(`last-group-cell class should be assigned to correct cells in ${view.name} when appointments are grouped by date`, async function(assert) {
- const instance = this.createInstance(view.class, {
- groupByDate: true,
- });
- await applyWorkspaceGroups(instance, [{
- label: 'one',
- fieldExpr: 'one',
- dataSource: [{ id: 1, text: 'a' }, { id: 2, text: 'b' }]
- }]);
-
- instance.$element().find(`.${CELL_CLASS}`).each(function(index) {
- checkLastGroupCell(assert, this, index, GROUP_COUNT, 'Date table');
- });
-
- instance.$element().find(`.${ALL_DAY_TABLE_CELL_CLASS}`).each(function(index) {
- checkLastGroupCell(assert, this, index, GROUP_COUNT, 'All-day panel');
- });
-
- instance.$element().find(`.${TIME_PANEL_CELL_CLASS}`).each(function() {
- assert.notOk($(this).hasClass(LAST_GROUP_CELL_CLASS), 'Time panel cell does not have last-group class');
- });
+ QUnit.test(`last-group-cell class should be assigned to correct cells in ${view.name} when appointments are grouped vertically`, async function(assert) {
+ const instance = this.createInstance(view.class, {
+ groupOrientation: 'vertical',
+ });
+ await applyWorkspaceGroups(instance, [{
+ label: 'one',
+ fieldExpr: 'one',
+ dataSource: [{ id: 1, text: 'a' }, { id: 2, text: 'b' }]
+ }]);
+
+ instance.$element().find(`.${CELL_CLASS}`).each(function(index) {
+ if((Math.floor(index / columnCountInGroup) + 1) % rowCountInGroup === 0) {
+ assert.ok($(this).hasClass(LAST_GROUP_CELL_CLASS), 'Date table cell has last-group class');
+ } else {
+ assert.notOk($(this).hasClass(LAST_GROUP_CELL_CLASS), 'Date table cell does not have last-group class');
+ }
+ });
+
+ instance.$element().find(`.${ALL_DAY_TABLE_CELL_CLASS}`).each(function() {
+ assert.notOk($(this).hasClass(LAST_GROUP_CELL_CLASS), 'All-day panel cell does not have last-group class');
+ });
- instance.$element().find(`.${HEADER_PANEL_CELL_CLASS}`).each(function() {
- assert.ok($(this).hasClass(LAST_GROUP_CELL_CLASS), 'Header panel cell has last-group class');
- });
+ instance.$element().find(`.${TIME_PANEL_CELL_CLASS}`).each(function(index) {
+ if((index + 1) % rowCountInGroup === 0) {
+ assert.ok($(this).hasClass(LAST_GROUP_CELL_CLASS), 'Time panel cell has last-group class');
+ } else {
+ assert.notOk($(this).hasClass(LAST_GROUP_CELL_CLASS), 'Time panel cell does not have last-group class');
+ }
});
- QUnit.test(`last-group-cell class should be assigned to correct cells in ${view.name} when appointments are grouped vertically`, async function(assert) {
- const instance = this.createInstance(view.class, {
- groupOrientation: 'vertical',
- });
- await applyWorkspaceGroups(instance, [{
- label: 'one',
- fieldExpr: 'one',
- dataSource: [{ id: 1, text: 'a' }, { id: 2, text: 'b' }]
- }]);
-
- instance.$element().find(`.${CELL_CLASS}`).each(function(index) {
- if((Math.floor(index / columnCountInGroup) + 1) % rowCountInGroup === 0) {
- assert.ok($(this).hasClass(LAST_GROUP_CELL_CLASS), 'Date table cell has last-group class');
- } else {
- assert.notOk($(this).hasClass(LAST_GROUP_CELL_CLASS), 'Date table cell does not have last-group class');
- }
- });
-
- instance.$element().find(`.${ALL_DAY_TABLE_CELL_CLASS}`).each(function() {
- assert.notOk($(this).hasClass(LAST_GROUP_CELL_CLASS), 'All-day panel cell does not have last-group class');
- });
-
- instance.$element().find(`.${TIME_PANEL_CELL_CLASS}`).each(function(index) {
- if((index + 1) % rowCountInGroup === 0) {
- assert.ok($(this).hasClass(LAST_GROUP_CELL_CLASS), 'Time panel cell has last-group class');
- } else {
- assert.notOk($(this).hasClass(LAST_GROUP_CELL_CLASS), 'Time panel cell does not have last-group class');
- }
- });
-
- instance.$element().find(`.${HEADER_PANEL_CELL_CLASS}`).each(function() {
- assert.notOk($(this).hasClass(LAST_GROUP_CELL_CLASS), 'Header panel cell does not have last-group class');
- });
+ instance.$element().find(`.${HEADER_PANEL_CELL_CLASS}`).each(function() {
+ assert.notOk($(this).hasClass(LAST_GROUP_CELL_CLASS), 'Header panel cell does not have last-group class');
});
});
});
diff --git a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/workSpace.month.tests.js b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/workSpace.month.tests.js
index 45519c1ef94a..8b30fd37d9a2 100644
--- a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/workSpace.month.tests.js
+++ b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/workSpace.month.tests.js
@@ -29,26 +29,22 @@ module('Work Space Month', () => {
}).dxSchedulerWorkSpaceMonth('instance');
}
}, () => {
- [true, false].forEach((renovateRender) => {
- test(`Scheduler all day panel is invisible on month view after switching showAllDayPanel option when renovateRender is ${renovateRender}`, async function(assert) {
- this.instance.option('renovateRender', renovateRender);
- this.instance.option('showAllDayPanel', false);
- this.instance.option('showAllDayPanel', true);
+ test('Scheduler all day panel is invisible on month view after switching showAllDayPanel option', async function(assert) {
+ this.instance.option('showAllDayPanel', false);
+ this.instance.option('showAllDayPanel', true);
- const $allDayPanel = this.instance.$element().find('.dx-scheduler-all-day-table-cell');
+ const $allDayPanel = this.instance.$element().find('.dx-scheduler-all-day-table-cell');
- assert.equal($allDayPanel.length, 0, 'allDay panel is invisible');
- });
+ assert.equal($allDayPanel.length, 0, 'allDay panel is invisible');
+ });
- test(`Scheduler all day title is invisible on month view after switching showAllDayPanel option when renovateRender is ${renovateRender}`, async function(assert) {
- this.instance.option('renovateRender', renovateRender);
- this.instance.option('showAllDayPanel', false);
- this.instance.option('showAllDayPanel', true);
+ test('Scheduler all day title is invisible on month view after switching showAllDayPanel option', async function(assert) {
+ this.instance.option('showAllDayPanel', false);
+ this.instance.option('showAllDayPanel', true);
- const $allDayTitle = this.instance.$element().find('.dx-scheduler-all-day-title');
+ const $allDayTitle = this.instance.$element().find('.dx-scheduler-all-day-title');
- assert.equal($allDayTitle.length, 0, 'All-day title is invisible');
- });
+ assert.equal($allDayTitle.length, 0, 'All-day title is invisible');
});
skip('Work space should find cell coordinates by date', async function(assert) {
@@ -107,108 +103,101 @@ module('Work Space Month', () => {
assert.deepEqual(this.instance.getDateRange(), [new Date(2015, 1, 23, 8, 0), new Date(2015, 3, 5, 19, 59)], 'Range is OK');
});
- test('Each cell should contain jQuery dxCellData depend on start day hour', async function(assert) {
+ test('Each cell should contain correct cellData depend on start day hour', async function(assert) {
this.instance.option({
currentDate: new Date(2015, 2, 16),
firstDayOfWeek: 1,
startDayHour: 5,
- renovateRender: false,
});
const $cell = this.instance.$element().find('.' + CELL_CLASS).eq(0);
- assert.deepEqual($cell.data('dxCellData'), {
+ assert.deepEqual(this.instance.getCellData($cell), {
startDate: new Date(2015, 1, 23, 5, 0),
endDate: new Date(2015, 1, 24, 0, 0),
groupIndex: 0,
});
});
- test('Each cell should contain jQuery dxCellData depend on end day hour', async function(assert) {
+ test('Each cell should contain correct cellData depend on end day hour', async function(assert) {
this.instance.option({
currentDate: new Date(2015, 2, 16),
firstDayOfWeek: 1,
endDayHour: 10,
- renovateRender: false,
});
const $cell = this.instance.$element().find('.' + CELL_CLASS).eq(0);
- assert.deepEqual($cell.data('dxCellData'), {
+ assert.deepEqual(this.instance.getCellData($cell), {
startDate: new Date(2015, 1, 23, 0, 0),
endDate: new Date(2015, 1, 23, 10, 0),
groupIndex: 0,
});
});
- test('Each cell should contain jQuery dxCellData depend on fractional hoursInterval', async function(assert) {
+ test('Each cell should contain correct cellData depend on fractional hoursInterval', async function(assert) {
this.instance.option({
currentDate: new Date(2015, 2, 16),
firstDayOfWeek: 1,
hoursInterval: 2.1666666666666665,
endDayHour: 5,
- renovateRender: false,
});
const $cell = this.instance.$element().find('.' + CELL_CLASS).eq(0);
- assert.deepEqual($cell.data('dxCellData'), {
+ assert.deepEqual(this.instance.getCellData($cell), {
startDate: new Date(2015, 1, 23, 0, 0),
endDate: new Date(2015, 1, 23, 5, 0),
groupIndex: 0,
});
});
- [true, false].forEach((renovateRender) => {
- test(`WorkSpace should calculate max left position when renovateRender is ${renovateRender}`, async function(assert) {
- this.instance.option({
- currentDate: new Date(2015, 2, 16),
- firstDayOfWeek: 1,
- renovateRender,
- });
+ test('WorkSpace should calculate max left position', async function(assert) {
+ this.instance.option({
+ currentDate: new Date(2015, 2, 16),
+ firstDayOfWeek: 1,
+ });
+
+ const $lastCell = this.instance.$element().find('.dx-scheduler-date-table').find('td').eq(6);
- const $lastCell = this.instance.$element().find('.dx-scheduler-date-table').find('td').eq(6);
+ assert.equal(Math.round(this.instance.getMaxAllowedPosition()),
+ Math.round($lastCell.position().left + getOuterWidth($lastCell)), 'Max left position is correct');
+ });
- assert.equal(Math.round(this.instance.getMaxAllowedPosition()),
- Math.round($lastCell.position().left + getOuterWidth($lastCell)), 'Max left position is correct');
+ test('Grouped work space should calculate max left position', async function(assert) {
+ const resourceConfig = await getWorkspaceResourceConfig([{
+ label: 'one',
+ fieldExpr: 'one',
+ dataSource: [{ id: 1, text: 'a' }, { id: 2, text: 'b' }]
+ }, {
+ label: 'two',
+ fieldExpr: 'two',
+ dataSource: [{ id: 1, text: 'c' }, { id: 2, text: 'd' }]
+ }]);
+ this.instance.option({
+ currentDate: new Date(2015, 2, 16),
+ firstDayOfWeek: 1,
+ ...resourceConfig,
});
- test(`Grouped work space should calculate max left position when renovateRender is ${renovateRender}`, async function(assert) {
- const resourceConfig = await getWorkspaceResourceConfig([{
- label: 'one',
- fieldExpr: 'one',
- dataSource: [{ id: 1, text: 'a' }, { id: 2, text: 'b' }]
- }, {
- label: 'two',
- fieldExpr: 'two',
- dataSource: [{ id: 1, text: 'c' }, { id: 2, text: 'd' }]
- }]);
- this.instance.option({
- currentDate: new Date(2015, 2, 16),
- firstDayOfWeek: 1,
- ...resourceConfig,
- renovateRender,
- });
-
- const $cells = this.instance.$element().find('.dx-scheduler-date-table tr').first().find('td');
- const $firstGroupLastCell = $cells.eq(6);
- const $secondGroupLastCell = $cells.eq(13);
- const $thirdGroupLastCell = $cells.eq(20);
- const $fourthGroupLastCell = $cells.eq(27);
-
- const expectedResult = [
- $firstGroupLastCell.position().left + $firstGroupLastCell.get(0).getBoundingClientRect().width,
- $secondGroupLastCell.position().left + $secondGroupLastCell.get(0).getBoundingClientRect().width,
- $thirdGroupLastCell.position().left + $thirdGroupLastCell.get(0).getBoundingClientRect().width,
- $fourthGroupLastCell.position().left + $fourthGroupLastCell.get(0).getBoundingClientRect().width
- ];
-
- const actualResult = [0, 1, 2, 3].map((groupIndex) => {
- return this.instance.getMaxAllowedPosition(groupIndex);
- });
-
- assert.deepEqual(actualResult, expectedResult, 'Max left positions are correct');
+ const $cells = this.instance.$element().find('.dx-scheduler-date-table tr').first().find('td');
+ const $firstGroupLastCell = $cells.eq(6);
+ const $secondGroupLastCell = $cells.eq(13);
+ const $thirdGroupLastCell = $cells.eq(20);
+ const $fourthGroupLastCell = $cells.eq(27);
+
+ const expectedResult = [
+ $firstGroupLastCell.position().left + $firstGroupLastCell.get(0).getBoundingClientRect().width,
+ $secondGroupLastCell.position().left + $secondGroupLastCell.get(0).getBoundingClientRect().width,
+ $thirdGroupLastCell.position().left + $thirdGroupLastCell.get(0).getBoundingClientRect().width,
+ $fourthGroupLastCell.position().left + $fourthGroupLastCell.get(0).getBoundingClientRect().width
+ ];
+
+ const actualResult = [0, 1, 2, 3].map((groupIndex) => {
+ return this.instance.getMaxAllowedPosition(groupIndex);
});
+
+ assert.deepEqual(actualResult, expectedResult, 'Max left positions are correct');
});
test('Group width calculation', async function(assert) {
@@ -241,8 +230,6 @@ module('Work Space Month', () => {
});
test('Get cell count to last view dates', async function(assert) {
- this.instance.option('renovateRender', false);
-
this.instance.option({
currentDate: new Date(2016, 2, 14, 0, 0),
startDayHour: 5,
@@ -251,7 +238,7 @@ module('Work Space Month', () => {
const $cell = this.instance.getCells().eq(14);
- assert.deepEqual($cell.data('dxCellData'), {
+ assert.deepEqual(this.instance.getCellData($cell), {
startDate: new Date(2016, 2, 14, 5, 0),
endDate: new Date(2016, 2, 15, 0, 0),
groupIndex: 0,
@@ -268,11 +255,10 @@ module('Work Space Month', () => {
currentDate: new Date(2018, 2, 1),
groupOrientation: 'vertical',
...resourceConfig,
- renovateRender: false,
});
- const firstCellData = this.instance.$element().find('.dx-scheduler-date-table-cell').eq(0).data('dxCellData');
- const secondCellData = this.instance.$element().find('.dx-scheduler-date-table-cell').eq(51).data('dxCellData');
+ const firstCellData = this.instance.getCellData(this.instance.$element().find('.dx-scheduler-date-table-cell').eq(0));
+ const secondCellData = this.instance.getCellData(this.instance.$element().find('.dx-scheduler-date-table-cell').eq(51));
assert.deepEqual(firstCellData.startDate, new Date(2018, 1, 25, 0), 'cell has right startDate');
assert.deepEqual(firstCellData.endDate, new Date(2018, 1, 26, 0), 'cell has right endtDate');
@@ -396,12 +382,11 @@ module('Work Space Month', () => {
intervalCount: 3,
currentDate: new Date(2017, 4, 25),
startDate: new Date(2017, 0, 15),
- renovateRender: false,
});
- const firstCellData = this.instance.$element().find('.dx-scheduler-date-table-cell').eq(0).data('dxCellData');
- const secondCellData = this.instance.$element().find('.dx-scheduler-date-table-cell').eq(35).data('dxCellData');
- const thirdCellData = this.instance.$element().find('.dx-scheduler-date-table-cell').last().data('dxCellData');
+ const firstCellData = this.instance.getCellData(this.instance.$element().find('.dx-scheduler-date-table-cell').eq(0));
+ const secondCellData = this.instance.getCellData(this.instance.$element().find('.dx-scheduler-date-table-cell').eq(35));
+ const thirdCellData = this.instance.getCellData(this.instance.$element().find('.dx-scheduler-date-table-cell').last());
assert.deepEqual(firstCellData.startDate, new Date(2017, 2, 26, 0), 'cell has right startDate');
assert.deepEqual(firstCellData.endDate, new Date(2017, 2, 27, 0), 'cell has right endtDate');
@@ -418,12 +403,11 @@ module('Work Space Month', () => {
intervalCount: 3,
currentDate: new Date(2017, 1, 15),
startDate: new Date(2017, 5, 15),
- renovateRender: false,
});
- const firstCellData = this.instance.$element().find('.dx-scheduler-date-table-cell').eq(0).data('dxCellData');
- const secondCellData = this.instance.$element().find('.dx-scheduler-date-table-cell').eq(35).data('dxCellData');
- const thirdCellData = this.instance.$element().find('.dx-scheduler-date-table-cell').last().data('dxCellData');
+ const firstCellData = this.instance.getCellData(this.instance.$element().find('.dx-scheduler-date-table-cell').eq(0));
+ const secondCellData = this.instance.getCellData(this.instance.$element().find('.dx-scheduler-date-table-cell').eq(35));
+ const thirdCellData = this.instance.getCellData(this.instance.$element().find('.dx-scheduler-date-table-cell').last());
assert.deepEqual(firstCellData.startDate, new Date(2016, 10, 27, 0), 'cell has right startDate');
assert.deepEqual(firstCellData.endDate, new Date(2016, 10, 28, 0), 'cell has right endtDate');
@@ -440,12 +424,11 @@ module('Work Space Month', () => {
intervalCount: 3,
currentDate: new Date(2017, 6, 15),
startDate: new Date(2017, 5, 15),
- renovateRender: false,
});
- const firstCellData = this.instance.$element().find('.dx-scheduler-date-table-cell').eq(0).data('dxCellData');
- const secondCellData = this.instance.$element().find('.dx-scheduler-date-table-cell').eq(35).data('dxCellData');
- const thirdCellData = this.instance.$element().find('.dx-scheduler-date-table-cell').last().data('dxCellData');
+ const firstCellData = this.instance.getCellData(this.instance.$element().find('.dx-scheduler-date-table-cell').eq(0));
+ const secondCellData = this.instance.getCellData(this.instance.$element().find('.dx-scheduler-date-table-cell').eq(35));
+ const thirdCellData = this.instance.getCellData(this.instance.$element().find('.dx-scheduler-date-table-cell').last());
assert.deepEqual(firstCellData.startDate, new Date(2017, 4, 28, 0), 'cell has right startDate');
assert.deepEqual(firstCellData.endDate, new Date(2017, 4, 29, 0), 'cell has right endtDate');
diff --git a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/workSpace.navigation.tests.js b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/workSpace.navigation.tests.js
index c11bba1ae870..d03874c30bc9 100644
--- a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/workSpace.navigation.tests.js
+++ b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/workSpace.navigation.tests.js
@@ -46,7 +46,7 @@ module('Workspace navigation', () => {
return $('#scheduler-work-space')[workSpaceName]({
currentDate: new Date(2021, 0, 10),
scrolling: { mode: scrollingMode, orientation: 'vertical' },
- renovateRender: true,
+
getResourceManager: getEmptyResourceManager,
...options,
});
@@ -979,7 +979,7 @@ module('Workspace navigation', () => {
this.createInstance = (options, workSpaceName) => {
return $('#scheduler-work-space')[workSpaceName]({
scrolling: { mode: scrollingMode, orientation: 'vertical' },
- renovateRender: true,
+
currentDate: new Date(2021, 0, 10),
getResourceManager: getEmptyResourceManager,
...options,
diff --git a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/workSpace.renovation.tests.js b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/workSpace.renovation.tests.js
index 92fe4294faa8..551cc2999625 100644
--- a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/workSpace.renovation.tests.js
+++ b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/workSpace.renovation.tests.js
@@ -51,7 +51,6 @@ module('Renovated Render', {
beforeEach() {
this.createInstance = (options = {}, workSpace = 'dxSchedulerWorkSpaceDay') => {
this.instance = $('#scheduler-work-space')[workSpace]({
- renovateRender: true,
currentDate: new Date(2020, 6, 29),
startDayHour: 0,
endDayHour: 1,
diff --git a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/workSpace.week.tests.js b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/workSpace.week.tests.js
index 59b8c3390b21..00caa5eb920f 100644
--- a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/workSpace.week.tests.js
+++ b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/workSpace.week.tests.js
@@ -170,17 +170,16 @@ module('Work Space Week', () => {
assert.deepEqual(this.instance.getDateRange(), [new Date(2015, 2, 16, 2, 0), new Date(2015, 2, 22, 2, 59)], 'Range is OK');
});
- test('Each cell should contain jQuery dxCellData depend on start day hour', async function(assert) {
+ test('Each cell should contain correct cellData depend on start day hour', async function(assert) {
this.instance.option({
currentDate: new Date(2015, 2, 16),
firstDayOfWeek: 1,
startDayHour: 5,
- renovateRender: false,
});
const $cell = this.instance.$element().find(CLASSES.dateTableCell).eq(8);
- assert.deepEqual($cell.data('dxCellData'), {
+ assert.deepEqual(this.instance.getCellData($cell), {
startDate: new Date(2015, 2, 17, 5, 30),
endDate: new Date(2015, 2, 17, 6, 0),
allDay: false,
@@ -188,17 +187,16 @@ module('Work Space Week', () => {
});
});
- test('Each cell should contain jQuery dxCellData depend on end day hour', async function(assert) {
+ test('Each cell should contain correct cellData depend on end day hour', async function(assert) {
this.instance.option({
currentDate: new Date(2015, 2, 4),
firstDayOfWeek: 1,
endDayHour: 10,
- renovateRender: false,
});
const $cell = this.instance.$element().find(CLASSES.dateTableCell).eq(8);
- assert.deepEqual($cell.data('dxCellData'), {
+ assert.deepEqual(this.instance.getCellData($cell), {
startDate: new Date(2015, 2, 3, 0, 30),
endDate: new Date(2015, 2, 3, 1, 0),
allDay: false,
@@ -268,10 +266,9 @@ module('Work Space Week', () => {
currentDate: new Date(2016, 10, 6),
firstDayOfWeek: 0,
startDayHour: 1,
- renovateRender: false,
});
- const cellData = this.instance.$element().find('.dx-scheduler-date-table-row').eq(1).find('.dx-scheduler-date-table-cell').eq(0).data('dxCellData');
+ const cellData = this.instance.getCellData(this.instance.$element().find('.dx-scheduler-date-table-row').eq(1).find('.dx-scheduler-date-table-cell').eq(0));
assert.equal(cellData.startDate.toString(), new Date(2016, 10, 6, 1, 30).toString(), 'Start date is OK');
assert.equal(cellData.endDate.toString(), new Date(2016, 10, 6, 2).toString(), 'End date is OK');
@@ -403,11 +400,10 @@ module('Work Space Week', () => {
groupOrientation: 'vertical',
startDayHour: 9,
...resourceConfig,
- renovateRender: false,
});
- const firstCellData = this.instance.$element().find('.dx-scheduler-date-table-cell').eq(25).data('dxCellData');
- const secondCellData = this.instance.$element().find('.dx-scheduler-date-table-cell').eq(248).data('dxCellData');
+ const firstCellData = this.instance.getCellData(this.instance.$element().find('.dx-scheduler-date-table-cell').eq(25));
+ const secondCellData = this.instance.getCellData(this.instance.$element().find('.dx-scheduler-date-table-cell').eq(248));
assert.deepEqual(firstCellData.startDate, new Date(2018, 2, 15, 10, 30), 'cell has right startDate');
assert.deepEqual(firstCellData.endDate, new Date(2018, 2, 15, 11), 'cell has right endtDate');
@@ -533,11 +529,10 @@ module('Work Space Week', () => {
this.createInstance({
intervalCount: 2,
currentDate: new Date(2017, 5, 25),
- renovateRender: false,
});
- const firstCellData = this.instance.$element().find('.dx-scheduler-date-table-cell').eq(6).data('dxCellData');
- const secondCellData = this.instance.$element().find('.dx-scheduler-date-table-cell').eq(671).data('dxCellData');
+ const firstCellData = this.instance.getCellData(this.instance.$element().find('.dx-scheduler-date-table-cell').eq(6));
+ const secondCellData = this.instance.getCellData(this.instance.$element().find('.dx-scheduler-date-table-cell').eq(671));
assert.deepEqual(firstCellData.startDate, new Date(2017, 6, 1, 0), 'cell has right startDate');
assert.deepEqual(firstCellData.endDate, new Date(2017, 6, 1, 0, 30), 'cell has right endtDate');
@@ -553,12 +548,11 @@ module('Work Space Week', () => {
firstDayOfWeek: 1,
currentDate: new Date(2017, 6, 26),
startDate: new Date(2017, 6, 4),
- renovateRender: false,
});
- const firstCellData = this.instance.$element().find('.dx-scheduler-date-table-cell').eq(0).data('dxCellData');
- const secondCellData = this.instance.$element().find('.dx-scheduler-date-table-cell').eq(240).data('dxCellData');
- const thirdCellData = this.instance.$element().find('.dx-scheduler-date-table-cell').eq(503).data('dxCellData');
+ const firstCellData = this.instance.getCellData(this.instance.$element().find('.dx-scheduler-date-table-cell').eq(0));
+ const secondCellData = this.instance.getCellData(this.instance.$element().find('.dx-scheduler-date-table-cell').eq(240));
+ const thirdCellData = this.instance.getCellData(this.instance.$element().find('.dx-scheduler-date-table-cell').eq(503));
assert.deepEqual(firstCellData.startDate, new Date(2017, 6, 24, 0), 'cell has right startDate');
assert.deepEqual(firstCellData.endDate, new Date(2017, 6, 24, 1), 'cell has right endtDate');
@@ -577,12 +571,11 @@ module('Work Space Week', () => {
firstDayOfWeek: 1,
currentDate: new Date(2017, 6, 4),
startDate: new Date(2017, 6, 26),
- renovateRender: false,
});
- const firstCellData = this.instance.$element().find('.dx-scheduler-date-table-cell').eq(0).data('dxCellData');
- const secondCellData = this.instance.$element().find('.dx-scheduler-date-table-cell').eq(160).data('dxCellData');
- const thirdCellData = this.instance.$element().find('.dx-scheduler-date-table-cell').eq(335).data('dxCellData');
+ const firstCellData = this.instance.getCellData(this.instance.$element().find('.dx-scheduler-date-table-cell').eq(0));
+ const secondCellData = this.instance.getCellData(this.instance.$element().find('.dx-scheduler-date-table-cell').eq(160));
+ const thirdCellData = this.instance.getCellData(this.instance.$element().find('.dx-scheduler-date-table-cell').eq(335));
assert.deepEqual(firstCellData.startDate, new Date(2017, 5, 26, 0), 'cell has right startDate');
assert.deepEqual(firstCellData.endDate, new Date(2017, 5, 26, 1), 'cell has right endtDate');
@@ -716,12 +709,11 @@ module('Work Space Work Week', () => {
this.createInstance({
intervalCount: 2,
currentDate: new Date(2017, 5, 25),
- renovateRender: false,
});
- const firstCellData = this.instance.$element().find('.dx-scheduler-date-table-cell').eq(4).data('dxCellData');
- const secondCellData = this.instance.$element().find('.dx-scheduler-date-table-cell').eq(5).data('dxCellData');
- const thirdCellData = this.instance.$element().find('.dx-scheduler-date-table-cell').eq(479).data('dxCellData');
+ const firstCellData = this.instance.getCellData(this.instance.$element().find('.dx-scheduler-date-table-cell').eq(4));
+ const secondCellData = this.instance.getCellData(this.instance.$element().find('.dx-scheduler-date-table-cell').eq(5));
+ const thirdCellData = this.instance.getCellData(this.instance.$element().find('.dx-scheduler-date-table-cell').eq(479));
assert.deepEqual(firstCellData.startDate, new Date(2017, 5, 30, 0), 'cell has right startDate');
assert.deepEqual(firstCellData.endDate, new Date(2017, 5, 30, 0, 30), 'cell has right endtDate');
@@ -740,12 +732,11 @@ module('Work Space Work Week', () => {
firstDayOfWeek: 1,
currentDate: new Date(2017, 6, 26),
startDate: new Date(2017, 6, 4),
- renovateRender: false,
});
- const firstCellData = this.instance.$element().find('.dx-scheduler-date-table-cell').eq(0).data('dxCellData');
- const secondCellData = this.instance.$element().find('.dx-scheduler-date-table-cell').eq(82).data('dxCellData');
- const thirdCellData = this.instance.$element().find('.dx-scheduler-date-table-cell').last().data('dxCellData');
+ const firstCellData = this.instance.getCellData(this.instance.$element().find('.dx-scheduler-date-table-cell').eq(0));
+ const secondCellData = this.instance.getCellData(this.instance.$element().find('.dx-scheduler-date-table-cell').eq(82));
+ const thirdCellData = this.instance.getCellData(this.instance.$element().find('.dx-scheduler-date-table-cell').last());
assert.deepEqual(firstCellData.startDate, new Date(2017, 6, 24, 0), 'cell has right startDate');
assert.deepEqual(firstCellData.endDate, new Date(2017, 6, 24, 1), 'cell has right endtDate');
@@ -764,12 +755,11 @@ module('Work Space Work Week', () => {
firstDayOfWeek: 1,
currentDate: new Date(2017, 6, 4),
startDate: new Date(2017, 6, 26),
- renovateRender: false,
});
- const firstCellData = this.instance.$element().find('.dx-scheduler-date-table-cell').eq(0).data('dxCellData');
- const secondCellData = this.instance.$element().find('.dx-scheduler-date-table-cell').eq(36).data('dxCellData');
- const thirdCellData = this.instance.$element().find('.dx-scheduler-date-table-cell').last().data('dxCellData');
+ const firstCellData = this.instance.getCellData(this.instance.$element().find('.dx-scheduler-date-table-cell').eq(0));
+ const secondCellData = this.instance.getCellData(this.instance.$element().find('.dx-scheduler-date-table-cell').eq(36));
+ const thirdCellData = this.instance.getCellData(this.instance.$element().find('.dx-scheduler-date-table-cell').last());
assert.deepEqual(firstCellData.startDate, new Date(2017, 5, 26, 0), 'cell has right startDate');
assert.deepEqual(firstCellData.endDate, new Date(2017, 5, 26, 1), 'cell has right endtDate');
@@ -799,7 +789,6 @@ module('Work Space Work Week', () => {
hoursInterval: 1,
firstDayOfWeek: 1,
currentDate: new Date(2017, 6, 4),
- renovateRender: false,
getResourceManager: getEmptyResourceManager,
});
@@ -809,10 +798,10 @@ module('Work Space Work Week', () => {
dataSource: [{ id: 1, text: 'a.1' }, { id: 2, text: 'a.2' }]
}]);
- const firstCellData = this.instance.$element().find('.dx-scheduler-date-table-cell').eq(0).data('dxCellData');
- const secondCellData = this.instance.$element().find('.dx-scheduler-date-table-cell').eq(5).data('dxCellData');
- const thirdCellData = this.instance.$element().find('.dx-scheduler-date-table-cell').eq(10).data('dxCellData');
- const lastCellData = this.instance.$element().find('.dx-scheduler-date-table-cell').eq(15).data('dxCellData');
+ const firstCellData = this.instance.getCellData(this.instance.$element().find('.dx-scheduler-date-table-cell').eq(0));
+ const secondCellData = this.instance.getCellData(this.instance.$element().find('.dx-scheduler-date-table-cell').eq(5));
+ const thirdCellData = this.instance.getCellData(this.instance.$element().find('.dx-scheduler-date-table-cell').eq(10));
+ const lastCellData = this.instance.getCellData(this.instance.$element().find('.dx-scheduler-date-table-cell').eq(15));
assert.deepEqual(firstCellData.startDate, new Date(2017, 6, 3, 0), 'cell has right startDate');
assert.deepEqual(firstCellData.endDate, new Date(2017, 6, 3, 1), 'cell has right endtDate');
|
|---|