Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export class IgxTreeGridAPIService extends GridBaseAPIService<GridType> {
if (expanded !== undefined) {
return expanded;
} else {
return record.children && record.children.length && record.level < grid.expansionDepth;
return record.children && !!record.children.length && record.level < grid.expansionDepth;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,15 @@ describe('IgxTreeGrid - Expanding / Collapsing #tGrid', () => {
treeGrid = fix.componentInstance.treeGrid;
});

it('should return boolean for expand state of row without children using getRowByKey()', () => {
treeGrid.primaryKey = "ID";
treeGrid.childDataKey = "";
fix.detectChanges();

const testRow = treeGrid.getRowByKey(147);
expect(testRow.expanded).toEqual(false);
});

it('check row expanding and collapsing are changing rows count (UI)', () => {
let rows = TreeGridFunctions.getAllRows(fix);
expect(rows.length).toBe(4);
Expand Down
Loading