Skip to content

Commit 1c1f6ca

Browse files
MKirovaMKirova
authored andcommitted
chore(*): Update tests so that they don't scroll and then focus the grid as that reset scroll to 0.
1 parent 797d9a9 commit 1c1f6ca

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

projects/igniteui-angular/src/lib/grids/hierarchical-grid/hierarchical-grid-navigation.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export class IgxHierarchicalGridNavigationService extends IgxGridNavigationServi
102102
}
103103

104104
focusTbody(event) {
105-
if (!this.activeNode || !this.activeNode.row) {
105+
if (!this.activeNode || this.activeNode.row === null) {
106106
this.activeNode = {
107107
row: 0,
108108
column: 0

projects/igniteui-angular/src/lib/grids/hierarchical-grid/hierarchical-grid.navigation.spec.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ describe('IgxHierarchicalGrid Basic Navigation #hGrid', () => {
3737
hierarchicalGrid = fixture.componentInstance.hgrid;
3838
setupHierarchicalGridScrollDetection(fixture, hierarchicalGrid);
3939
baseHGridContent = GridFunctions.getGridContent(fixture);
40+
GridFunctions.focusFirstCell(fixture);
4041
}));
4142

4243
// simple tests
@@ -660,6 +661,7 @@ describe('IgxHierarchicalGrid Complex Navigation #hGrid', () => {
660661
hierarchicalGrid = fixture.componentInstance.hgrid;
661662
setupHierarchicalGridScrollDetection(fixture, hierarchicalGrid);
662663
baseHGridContent = GridFunctions.getGridContent(fixture);
664+
GridFunctions.focusFirstCell(fixture);
663665
}));
664666

665667
// complex tests
@@ -785,6 +787,7 @@ describe('IgxHierarchicalGrid sibling row islands Navigation #hGrid', () => {
785787
hierarchicalGrid = fixture.componentInstance.hgrid;
786788
setupHierarchicalGridScrollDetection(fixture, hierarchicalGrid);
787789
baseHGridContent = GridFunctions.getGridContent(fixture);
790+
GridFunctions.focusFirstCell(fixture);
788791
}));
789792

790793
it('should allow navigating up between sibling child grids.', (async () => {
@@ -912,6 +915,7 @@ describe('IgxHierarchicalGrid Smaller Child Navigation #hGrid', () => {
912915
hierarchicalGrid = fixture.componentInstance.hgrid;
913916
setupHierarchicalGridScrollDetection(fixture, hierarchicalGrid);
914917
baseHGridContent = GridFunctions.getGridContent(fixture);
918+
GridFunctions.focusFirstCell(fixture);
915919
}));
916920

917921
it('should navigate to last cell in next row for child grid using Arrow Down from last cell of parent with more columns', (async () => {

0 commit comments

Comments
 (0)