@@ -3,17 +3,18 @@ import { IgxHierarchicalGridModule, IgxHierarchicalGridComponent } from './publi
3
3
import { configureTestSuite } from '../../test-utils/configure-suite' ;
4
4
import { NoopAnimationsModule } from '@angular/platform-browser/animations' ;
5
5
import { 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' ;
7
8
8
- describe ( 'IgxTreeGrid - Add Row UI #tGrid' , ( ) => {
9
+ describe ( 'IgxHierarchicalGrid - Add Row UI #tGrid' , ( ) => {
9
10
configureTestSuite ( ) ;
10
11
let fixture ;
11
12
let hierarchicalGrid : IgxHierarchicalGridComponent ;
12
13
let actionStrip : IgxActionStripComponent ;
13
14
beforeAll ( async ( ( ) => {
14
15
TestBed . configureTestingModule ( {
15
16
declarations : [
16
- IgxHierarchicalGridEditActionsComponent
17
+ IgxHierarchicalGridActionStripComponent
17
18
] ,
18
19
imports : [ IgxHierarchicalGridModule , NoopAnimationsModule , IgxActionStripModule ]
19
20
} )
@@ -22,7 +23,7 @@ describe('IgxTreeGrid - Add Row UI #tGrid', () => {
22
23
23
24
describe ( ' Basic' , ( ) => {
24
25
beforeEach ( fakeAsync ( /** height/width setter rAF */ ( ) => {
25
- fixture = TestBed . createComponent ( IgxHierarchicalGridEditActionsComponent ) ;
26
+ fixture = TestBed . createComponent ( IgxHierarchicalGridActionStripComponent ) ;
26
27
fixture . detectChanges ( ) ;
27
28
hierarchicalGrid = fixture . componentInstance . hgrid ;
28
29
actionStrip = fixture . componentInstance . actionStrip ;
@@ -40,7 +41,7 @@ describe('IgxTreeGrid - Add Row UI #tGrid', () => {
40
41
expect ( hierarchicalGrid . getRowByIndex ( 1 ) . addRow ) . toBeTrue ( ) ;
41
42
} ) ;
42
43
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 ( ) => {
44
45
const row = hierarchicalGrid . rowList . first ;
45
46
hierarchicalGrid . expandRow ( row . rowID ) ;
46
47
fixture . detectChanges ( ) ;
@@ -52,6 +53,11 @@ describe('IgxTreeGrid - Add Row UI #tGrid', () => {
52
53
expect ( hierarchicalGrid . getRowByIndex ( 1 ) . addRow ) . toBeTrue ( ) ;
53
54
hierarchicalGrid . endEdit ( true ) ;
54
55
fixture . detectChanges ( ) ;
56
+ hierarchicalGrid . addRowSnackbar . triggerAction ( ) ;
57
+ fixture . detectChanges ( ) ;
58
+
59
+ await wait ( 100 ) ;
60
+ fixture . detectChanges ( ) ;
55
61
56
62
const newRowData = hierarchicalGrid . data [ hierarchicalGrid . data . length - 1 ] ;
57
63
const newRow = hierarchicalGrid . rowList . find ( r => r . rowID === newRowData [ hierarchicalGrid . primaryKey ] ) ;
0 commit comments