@@ -3,17 +3,18 @@ import { IgxHierarchicalGridModule, IgxHierarchicalGridComponent } from './publi
33import { configureTestSuite } from '../../test-utils/configure-suite' ;
44import { NoopAnimationsModule } from '@angular/platform-browser/animations' ;
55import { IgxActionStripModule , IgxActionStripComponent } from '../../action-strip/public_api' ;
6- import { IgxHierarchicalGridEditActionsComponent } from '../../test-utils/hierarchical-grid-components.spec' ;
6+ import { IgxHierarchicalGridActionStripComponent } from '../../test-utils/hierarchical-grid-components.spec' ;
7+ import { wait } from '../../test-utils/ui-interactions.spec' ;
78
8- describe ( 'IgxTreeGrid - Add Row UI #tGrid' , ( ) => {
9+ describe ( 'IgxHierarchicalGrid - Add Row UI #tGrid' , ( ) => {
910 configureTestSuite ( ) ;
1011 let fixture ;
1112 let hierarchicalGrid : IgxHierarchicalGridComponent ;
1213 let actionStrip : IgxActionStripComponent ;
1314 beforeAll ( async ( ( ) => {
1415 TestBed . configureTestingModule ( {
1516 declarations : [
16- IgxHierarchicalGridEditActionsComponent
17+ IgxHierarchicalGridActionStripComponent
1718 ] ,
1819 imports : [ IgxHierarchicalGridModule , NoopAnimationsModule , IgxActionStripModule ]
1920 } )
@@ -22,7 +23,7 @@ describe('IgxTreeGrid - Add Row UI #tGrid', () => {
2223
2324 describe ( ' Basic' , ( ) => {
2425 beforeEach ( fakeAsync ( /** height/width setter rAF */ ( ) => {
25- fixture = TestBed . createComponent ( IgxHierarchicalGridEditActionsComponent ) ;
26+ fixture = TestBed . createComponent ( IgxHierarchicalGridActionStripComponent ) ;
2627 fixture . detectChanges ( ) ;
2728 hierarchicalGrid = fixture . componentInstance . hgrid ;
2829 actionStrip = fixture . componentInstance . actionStrip ;
@@ -40,7 +41,7 @@ describe('IgxTreeGrid - Add Row UI #tGrid', () => {
4041 expect ( hierarchicalGrid . getRowByIndex ( 1 ) . addRow ) . toBeTrue ( ) ;
4142 } ) ;
4243
43- it ( 'Should allow the expansion of a newly added (commited) record' , ( ) => {
44+ it ( 'Should allow the expansion of a newly added (commited) record' , async ( ) => {
4445 const row = hierarchicalGrid . rowList . first ;
4546 hierarchicalGrid . expandRow ( row . rowID ) ;
4647 fixture . detectChanges ( ) ;
@@ -52,6 +53,11 @@ describe('IgxTreeGrid - Add Row UI #tGrid', () => {
5253 expect ( hierarchicalGrid . getRowByIndex ( 1 ) . addRow ) . toBeTrue ( ) ;
5354 hierarchicalGrid . endEdit ( true ) ;
5455 fixture . detectChanges ( ) ;
56+ hierarchicalGrid . addRowSnackbar . triggerAction ( ) ;
57+ fixture . detectChanges ( ) ;
58+
59+ await wait ( 100 ) ;
60+ fixture . detectChanges ( ) ;
5561
5662 const newRowData = hierarchicalGrid . data [ hierarchicalGrid . data . length - 1 ] ;
5763 const newRow = hierarchicalGrid . rowList . find ( r => r . rowID === newRowData [ hierarchicalGrid . primaryKey ] ) ;
0 commit comments