-
Notifications
You must be signed in to change notification settings - Fork 595
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TreeList - Expand/collapse mechanism breaks after dragging action in …
…the space between the last row and the border (T1228650) (#27687)
- Loading branch information
Showing
5 changed files
with
87 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import TreeList from 'devextreme-testcafe-models/treeList'; | ||
import ExpandableCell from 'devextreme-testcafe-models/treeList/expandableCell'; | ||
|
||
import { createWidget } from '../../helpers/createWidget'; | ||
import url from '../../helpers/getPageUrl'; | ||
|
||
fixture`Row dragging` | ||
.page(url(__dirname, '../container.html')); | ||
|
||
const tasksT1228650 = [{ | ||
Task_ID: 1, | ||
Task_Subject: 'Plans 2015', | ||
Task_Parent_ID: 0, | ||
}, { | ||
Task_ID: 2, | ||
Task_Subject: 'Health Insurance', | ||
Task_Parent_ID: 1, | ||
}, { | ||
Task_ID: 3, | ||
Task_Subject: 'Training', | ||
Task_Parent_ID: 2, | ||
}]; | ||
|
||
test('TreeList - Expand/collapse mechanism breaks after dragging action in the space between the last row and the border (T1228650)', async (t) => { | ||
const treeList = new TreeList('#container'); | ||
const dataRow = treeList.getDataRow(0); | ||
const expandButton = (dataRow.getDataCell(0) as ExpandableCell).getExpandButton(); | ||
const freeSpaceRow = treeList.getFreeSpaceRow(); | ||
await t | ||
.dragToElement(freeSpaceRow, dataRow.element) | ||
.click(expandButton) | ||
.expect(treeList.getDataRow(1).element.exists) | ||
.ok(); | ||
}).before(async () => { | ||
await createWidget('dxTreeList', { | ||
dataSource: tasksT1228650, | ||
keyExpr: 'Task_ID', | ||
parentIdExpr: 'Task_Parent_ID', | ||
height: 200, | ||
wordWrapEnabled: true, | ||
showBorders: true, | ||
columns: [ | ||
{ | ||
dataField: 'test', | ||
dataType: 'boolean', | ||
}, | ||
{ | ||
dataField: 'Task_Subject', | ||
fixed: true, | ||
fixedPosition: 'right', | ||
}, | ||
], | ||
showColumnLines: true, | ||
rowDragging: { | ||
allowDropInsideItem: true, | ||
allowReordering: false, | ||
showDragIcons: false, | ||
group: 'none', | ||
}, | ||
}); | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import DataCell from "../dataGrid/data/cell"; | ||
|
||
const CLASS = { | ||
expandButton: 'dx-treelist-icon-container', | ||
}; | ||
|
||
export default class ExpandableCell extends DataCell { | ||
constructor(dataRow: Selector, index: number, widgetName: string) { | ||
super(dataRow, index, widgetName); | ||
} | ||
|
||
getExpandButton(): Selector { | ||
return this.element.find(`.${CLASS.expandButton}`); | ||
} | ||
} |
4 changes: 2 additions & 2 deletions
4
packages/testcafe-models/treeList.ts → packages/testcafe-models/treeList/index.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