|
1 | 1 | import { getScrollDistanceWhenDragOutsideGrid } from '../support/drag'; |
2 | 2 |
|
3 | 3 | function testScroll(fromClass: string, toClass: string, fromRow: number, fromCol: number) { |
4 | | - return getScrollDistanceWhenDragOutsideGrid(fromClass, 'topLeft', 'right', fromRow, fromCol, 165).then((cellScrollDistance) => { |
5 | | - return getScrollDistanceWhenDragOutsideGrid(toClass, 'topLeft', 'bottom', fromRow, fromCol, 165).then((rowScrollDistance) => { |
| 4 | + return getScrollDistanceWhenDragOutsideGrid(fromClass, 'topLeft', 'right', fromRow, fromCol, 165).then((cellScrollDistance: any) => { |
| 5 | + return getScrollDistanceWhenDragOutsideGrid(toClass, 'topLeft', 'bottom', fromRow, fromCol, 165).then((rowScrollDistance: any) => { |
6 | 6 | return cy.wrap({ |
7 | 7 | cell: { |
8 | 8 | scrollBefore: cellScrollDistance.scrollLeftBefore, |
@@ -104,7 +104,7 @@ describe('Example 48 - Hybrid Selection Model', () => { |
104 | 104 | it('should auto scroll take effect to display the selecting element when dragging', { scrollBehavior: false }, () => { |
105 | 105 | cy.get('#grid48-1 .slick-viewport-top.slick-viewport-left').scrollTo('top'); |
106 | 106 |
|
107 | | - testScroll('#grid48-1', '#grid48-1', 0, 1).then((scrollDistance) => { |
| 107 | + testScroll('#grid48-1', '#grid48-1', 0, 1).then((scrollDistance: { cell: any; row: any }) => { |
108 | 108 | expect(scrollDistance.cell.scrollBefore).to.be.lte(scrollDistance.cell.scrollAfter); |
109 | 109 | expect(scrollDistance.row.scrollBefore).to.be.lte(scrollDistance.row.scrollAfter); |
110 | 110 | }); |
@@ -136,7 +136,7 @@ describe('Example 48 - Hybrid Selection Model', () => { |
136 | 136 |
|
137 | 137 | cy.get('#grid48-2 .slick-row[data-row="1"] .slick-cell.l3.r3').trigger('mouseup', 'bottomRight', { which: 1, force: true }); |
138 | 138 |
|
139 | | - testScroll('#grid48-2', '#grid48-2', 0, 1).then((scrollDistance) => { |
| 139 | + testScroll('#grid48-2', '#grid48-2', 0, 1).then((scrollDistance: { cell: any; row: any }) => { |
140 | 140 | expect(scrollDistance.cell.scrollBefore).to.be.lte(scrollDistance.cell.scrollAfter); |
141 | 141 | expect(scrollDistance.row.scrollBefore).to.be.lte(scrollDistance.row.scrollAfter); |
142 | 142 | }); |
|
0 commit comments