Skip to content

Commit 94a4f87

Browse files
Scheduler - Fix unstable tests - QUnit timeline.tests.js (#32604)
1 parent c1ffeae commit 94a4f87

1 file changed

Lines changed: 0 additions & 178 deletions

File tree

packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/timeline.tests.js

Lines changed: 0 additions & 178 deletions
Original file line numberDiff line numberDiff line change
@@ -206,34 +206,6 @@ QUnit.test('Group table cells should have correct height', async function(assert
206206
assert.roughEqual(dateTableCellHeight, groupHeaderHeight, 1.1, 'Cell height is OK');
207207
});
208208

209-
QUnit.skip('the "getCoordinatesByDate" method should return right coordinates for grouped timeline', async function(assert) {
210-
const instance = $('#scheduler-timeline').dxSchedulerTimelineDay({
211-
'currentDate': new Date(2015, 9, 28),
212-
groupOrientation: 'vertical',
213-
getResourceManager: getEmptyResourceManager,
214-
}).dxSchedulerTimelineDay('instance');
215-
216-
await applyWorkspaceGroups(instance, [{
217-
label: 'one',
218-
fieldExpr: 'one',
219-
dataSource: [{ id: 1, text: 'a' }, { id: 2, text: 'b' }]
220-
}, {
221-
label: 'two',
222-
fieldExpr: 'two',
223-
dataSource: [{ id: 1, text: '1' }, { id: 2, text: '2' }]
224-
}]);
225-
226-
const coordinates = instance.positionHelper.getCoordinatesByDate(new Date(2015, 9, 28, 1), 1);
227-
const expectedPosition = instance.$element()
228-
.find('.dx-scheduler-date-table-row').eq(1)
229-
.find('.dx-scheduler-date-table-cell').eq(2)
230-
.position();
231-
232-
assert.equal(coordinates.left, expectedPosition.left, 'Coordinates are OK');
233-
assert.equal(coordinates.top, expectedPosition.top, 'Coordinates are OK');
234-
});
235-
236-
237209
QUnit.test('the \'getCellIndexByCoordinates\' method should return right coordinates', async function(assert) {
238210
const cellWidth = getOuterWidth(this.instance.$element().find('.dx-scheduler-date-table-cell').eq(0));
239211
const cellIndex = this.instance.getCellIndexByCoordinates({ left: cellWidth * 15, top: 1 });
@@ -328,43 +300,6 @@ QUnit.module('Timeline Day', {
328300
}
329301
});
330302

331-
[true, false].forEach((renovateRender) => {
332-
QUnit.skip(`the 'getCoordinatesByDate' method should return right coordinates when renovateRender is ${true}`, async function(assert) {
333-
this.instance.option({
334-
currentDate: new Date(2015, 10, 15),
335-
startDayHour: 9,
336-
hoursInterval: 1,
337-
renovateRender,
338-
});
339-
340-
const coordinates = this.instance.positionHelper.getCoordinatesByDate(new Date(2015, 10, 15, 10, 30), 0, false);
341-
const $expectedCell = this.instance.$element()
342-
.find('.dx-scheduler-date-table-cell').eq(1);
343-
const expectedPositionLeft = $expectedCell.position().left + 0.5 * getOuterWidth($expectedCell);
344-
345-
assert.roughEqual(coordinates.left, expectedPositionLeft, 1.001, 'left coordinate is OK');
346-
});
347-
348-
QUnit.skip(`the 'getCoordinatesByDate' method should return right coordinates for rtl mode when renovateRender is ${true}`, async function(assert) {
349-
this.instance.option({
350-
rtlEnabled: true,
351-
width: 100,
352-
currentDate: new Date(2015, 10, 15),
353-
startDayHour: 9,
354-
hoursInterval: 1,
355-
renovateRender,
356-
});
357-
358-
const coordinates = this.instance.positionHelper.getCoordinatesByDate(new Date(2015, 10, 15, 10, 30), 0, false);
359-
const $expectedCell = this.instance.$element()
360-
.find('.dx-scheduler-date-table-cell').eq(1);
361-
362-
const expectedPositionLeft = $expectedCell.position().left + getOuterWidth($expectedCell) - 0.5 * getOuterWidth($expectedCell);
363-
364-
assert.roughEqual(coordinates.left, expectedPositionLeft, 1.001, 'left coordinate is OK');
365-
});
366-
});
367-
368303
QUnit.module('Timeline Day, groupOrientation = horizontal', {
369304
beforeEach: async function() {
370305
const resourceConfig = await getWorkspaceResourceConfig([{
@@ -397,26 +332,6 @@ QUnit.test('Group table cells should have correct height, groupOrientation = hor
397332
assert.roughEqual(50, groupHeaderHeight, 1.1, 'Cell height is OK');
398333
});
399334

400-
QUnit.skip('the \'getCoordinatesByDate\' method should return right coordinates for grouped timeline, groupOrientation = horizontal', async function(assert) {
401-
this.instance.option({
402-
currentDate: new Date(2015, 9, 21),
403-
firstDayOfWeek: 1,
404-
startDayHour: 5,
405-
endDayHour: 8,
406-
hoursInterval: 1
407-
});
408-
409-
const coordinates = this.instance.positionHelper.getCoordinatesByDate(new Date(2015, 9, 21, 6), 1);
410-
const expectedPosition = this.instance.$element()
411-
.find('.dx-scheduler-date-table-row').eq(0)
412-
.find('.dx-scheduler-date-table-cell').eq(4)
413-
.position();
414-
415-
assert.equal(coordinates.left, expectedPosition.left, 'Coordinates are OK');
416-
assert.equal(coordinates.top, expectedPosition.top, 'Coordinates are OK');
417-
418-
});
419-
420335
QUnit.module('Timeline Week', {
421336
beforeEach: function() {
422337
this.instance = $('#scheduler-timeline').dxSchedulerTimelineWeek({
@@ -478,40 +393,6 @@ QUnit.test('Scheduler timeline week cells should have right height if crossScrol
478393
assert.roughEqual(getOuterHeight($firstRowCell), getOuterHeight($lastRowCell), 1.5, 'Cells has correct height');
479394
});
480395

481-
QUnit.skip('The part of long appointment should have right coordinates on current week (T342192) №3', async function(assert) {
482-
this.instance.option({
483-
currentDate: new Date(2015, 1, 23),
484-
firstDayOfWeek: 1,
485-
startDayHour: 1,
486-
endDayHour: 10,
487-
hoursInterval: 0.5
488-
});
489-
const coordinates = this.instance.positionHelper.getCoordinatesByDate(new Date(2015, 2, 1, 4, 30), 0, false);
490-
const $expectedCell = this.instance.$element().find('.dx-scheduler-date-table-cell').eq(115);
491-
492-
const expectedPositionLeft = $expectedCell.position().left;
493-
494-
assert.roughEqual(coordinates.left, expectedPositionLeft, 1.001, 'left coordinate is OK');
495-
496-
});
497-
498-
QUnit.skip('Timeline should find cell coordinates by date depend on start/end day hour & hoursInterval', async function(assert) {
499-
const $element = this.instance.$element();
500-
501-
this.instance.option({
502-
currentDate: new Date(2015, 2, 1),
503-
firstDayOfWeek: 0,
504-
startDayHour: 5,
505-
endDayHour: 10,
506-
hoursInterval: 0.75
507-
});
508-
509-
const coords = this.instance.positionHelper.getCoordinatesByDate(new Date(2015, 2, 2, 8, 0));
510-
511-
assert.equal(coords.top, $element.find('.dx-scheduler-date-table-cell').eq(11).position().top, 'Cell coordinates are right');
512-
assert.equal(coords.left, $element.find('.dx-scheduler-date-table-cell').eq(11).position().left, 'Cell coordinates are right');
513-
});
514-
515396
QUnit.module('Timeline Month', {
516397
beforeEach: function() {
517398
this.instance = $('#scheduler-timeline').dxSchedulerTimelineMonth({
@@ -534,14 +415,6 @@ QUnit.test('timeline should have correct group table width (T718364)', async fun
534415
assert.equal(this.instance.getGroupTableWidth(), 100, 'Group table width is OK');
535416
});
536417

537-
QUnit.skip('Scheduler timeline month getPositionShift should return null shift', async function(assert) {
538-
this.instance.option({
539-
currentDate: new Date(2015, 9, 21)
540-
});
541-
542-
assert.deepEqual(this.instance.getPositionShift(), { top: 0, left: 0, cellPosition: 0 }, 'First view date is OK');
543-
});
544-
545418
QUnit.test('Scrollables should be updated after currentDate changing', async function(assert) {
546419
this.instance.option({
547420
currentDate: new Date(2017, 1, 15)
@@ -802,35 +675,6 @@ QUnit.module('TimelineWorkWeek with intervalCount', {
802675
}
803676
});
804677

805-
QUnit.skip('\'getCoordinatesByDate\' should return right coordinates with view option intervalCount', async function(assert) {
806-
this.instance.option({
807-
intervalCount: 2,
808-
currentDate: new Date(2017, 5, 25),
809-
startDayHour: 8,
810-
endDayHour: 20
811-
});
812-
813-
const $element = this.instance.$element();
814-
815-
const coords = this.instance.positionHelper.getCoordinatesByDate(new Date(2017, 6, 6, 12, 0), 0, false);
816-
const targetCellPosition = $element.find('.dx-scheduler-date-table tbody td').eq(200).position();
817-
818-
assert.equal(coords.top, targetCellPosition.top, 'Cell coordinates are right');
819-
assert.equal(coords.left, targetCellPosition.left, 'Cell coordinates are right');
820-
});
821-
822-
QUnit.skip('\'getCoordinatesByDateInGroup\' method should return only work week days (t853629)', async function(assert) {
823-
this.instance.option({
824-
intervalCount: 2,
825-
currentDate: new Date(2018, 4, 21),
826-
});
827-
828-
assert.ok(!this.instance.positionHelper.getCoordinatesByDateInGroup(new Date(2018, 4, 26))[0]);
829-
assert.ok(!this.instance.positionHelper.getCoordinatesByDateInGroup(new Date(2018, 4, 27))[0]);
830-
assert.ok(this.instance.positionHelper.getCoordinatesByDateInGroup(new Date(2018, 4, 23))[0]);
831-
assert.ok(this.instance.positionHelper.getCoordinatesByDateInGroup(new Date(2018, 4, 28))[0]);
832-
});
833-
834678
QUnit.module('TimelineWeek with grouping by date', {
835679
beforeEach: async function() {
836680
this.instance = $('#scheduler-timeline').dxSchedulerTimelineWeek({
@@ -966,28 +810,6 @@ QUnit.test('Group table cells should have right cellData, groupByDate = true', a
966810
assert.equal($groupHeaderCells.eq(83).text(), 'b', 'Group header content height is OK');
967811
});
968812

969-
[true, false].forEach((renovateRender) => {
970-
QUnit.skip(`Timeline should find cell coordinates by date, groupByDate = true when renovateRender is ${renovateRender}`, async function(assert) {
971-
this.instance.option({
972-
currentDate: new Date(2015, 2, 4),
973-
renovateRender,
974-
});
975-
976-
let coords = this.instance.positionHelper.getCoordinatesByDate(new Date(2015, 2, 4, 9, 0), 0, false);
977-
const $element = this.instance.$element();
978-
979-
assert.equal(coords.top, $element.find('.dx-scheduler-date-table tbody td').eq(36).position().top, 'Top cell coordinates are right');
980-
assert.equal(coords.left, $element.find('.dx-scheduler-date-table tbody td').eq(36).position().left, 'Left cell coordinates are right');
981-
assert.equal(coords.hMax, 16800, 'hMax is right');
982-
983-
coords = this.instance.positionHelper.getCoordinatesByDate(new Date(2015, 2, 5, 9, 0), 1, false);
984-
985-
assert.equal(coords.top, $element.find('.dx-scheduler-date-table tbody td').eq(49).position().top, 'Top cell coordinates are right');
986-
assert.equal(coords.left, $element.find('.dx-scheduler-date-table tbody td').eq(49).position().left, 'Left cell coordinates are right');
987-
assert.equal(coords.hMax, 16800, 'hMax is right');
988-
});
989-
});
990-
991813
QUnit.module('TimelineDay with grouping by date', {
992814
beforeEach: async function() {
993815
const resourceConfig = await getWorkspaceResourceConfig([{

0 commit comments

Comments
 (0)