Skip to content

Commit 7443350

Browse files
committed
test(igxTreeGrid): Adds selection test w/ rp #6640
1 parent 58d08ef commit 7443350

File tree

1 file changed

+30
-2
lines changed

1 file changed

+30
-2
lines changed

projects/igniteui-angular/src/lib/grids/tree-grid/tree-grid-integration.spec.ts

+30-2
Original file line numberDiff line numberDiff line change
@@ -1556,8 +1556,36 @@ describe('IgxTreeGrid - Integration #tGrid', () => {
15561556
expect(treeGrid.getRowByIndex(2).rowID).toBe(847);
15571557
});
15581558

1559-
it('should not take into account pinned rows when changing items per page', () => {});
1559+
it('should not take into account pinned rows when changing items per page', () => {
1560+
treeGrid.pinRow(147);
1561+
fix.detectChanges();
1562+
1563+
treeGrid.paging = true;
1564+
treeGrid.perPage = 5;
1565+
fix.detectChanges();
15601566

1561-
it('should make a correct selection', () => {});
1567+
expect(treeGrid.dataView.length).toBe(5);
1568+
1569+
treeGrid.perPage = 10;
1570+
fix.detectChanges();
1571+
1572+
expect(treeGrid.dataView.length).toBe(10);
1573+
});
1574+
1575+
it('should make a correct selection', () => {
1576+
treeGrid.pinRow(147);
1577+
fix.detectChanges();
1578+
1579+
const range = { rowStart: 0, rowEnd: 2, columnStart: 'ID', columnEnd: 'Name' };
1580+
treeGrid.selectRange(range);
1581+
fix.detectChanges();
1582+
1583+
const selectedRange = treeGrid.getSelectedData();
1584+
expect(selectedRange).toEqual([
1585+
{ID: 147, Name: 'John Winchester'},
1586+
{ID: 147, Name: 'John Winchester'},
1587+
{ID: 475, Name: 'Michael Langdon'},
1588+
]);
1589+
});
15621590
});
15631591
});

0 commit comments

Comments
 (0)