@@ -628,6 +628,16 @@ describe('Basic IgxHierarchicalGrid #hGrid', () => {
628628 expect ( hierarchicalGrid . tbody . nativeElement . attributes [ 'aria-activedescendant' ] . value ) . toEqual ( hierarchicalGrid . id ) ;
629629 expect ( childGrid . tbody . nativeElement . attributes [ 'aria-activedescendant' ] . value ) . toEqual ( `${ childGrid . id } _0_1` ) ;
630630 } ) ;
631+
632+ it ( 'should emit columnInit when a column is added runtime.' , async ( ) => {
633+ spyOn ( hierarchicalGrid . columnInit , 'emit' ) . and . callThrough ( ) ;
634+ fixture . detectChanges ( ) ;
635+ fixture . componentInstance . showAnotherCol = true ;
636+ fixture . detectChanges ( ) ;
637+ await wait ( 30 ) ;
638+ fixture . detectChanges ( ) ;
639+ expect ( hierarchicalGrid . columnInit . emit ) . toHaveBeenCalled ( ) ;
640+ } ) ;
631641 } ) ;
632642
633643 describe ( 'IgxHierarchicalGrid Row Islands #hGrid' , ( ) => {
@@ -1827,6 +1837,7 @@ describe('Basic IgxHierarchicalGrid #hGrid', () => {
18271837 <igx-hierarchical-grid #grid1 [data]="data"
18281838 [autoGenerate]="false" [height]="'400px'" [width]="width" #hierarchicalGrid>
18291839 <igx-column field="ID"></igx-column>
1840+ <igx-column field="AnotherColumn" *ngIf="showAnotherCol"></igx-column>
18301841 <igx-column field="ProductName"></igx-column>
18311842 <igx-row-island [key]="'childData'" [autoGenerate]="false" #rowIsland>
18321843 <igx-column field="ID"></igx-column>
@@ -1839,15 +1850,15 @@ describe('Basic IgxHierarchicalGrid #hGrid', () => {
18391850 </igx-row-island>
18401851 </igx-hierarchical-grid>` ,
18411852 standalone : true ,
1842- imports : [ IgxHierarchicalGridComponent , IgxColumnComponent , IgxRowIslandComponent ]
1853+ imports : [ IgxHierarchicalGridComponent , IgxColumnComponent , IgxRowIslandComponent , NgIf ]
18431854} )
18441855export class IgxHierarchicalGridTestBaseComponent {
18451856 @ViewChild ( 'hierarchicalGrid' , { read : IgxHierarchicalGridComponent , static : true } ) public hgrid : IgxHierarchicalGridComponent ;
18461857 @ViewChild ( 'rowIsland' , { read : IgxRowIslandComponent , static : true } ) public rowIsland : IgxRowIslandComponent ;
18471858 @ViewChild ( 'rowIsland2' , { read : IgxRowIslandComponent , static : true } ) public rowIsland2 : IgxRowIslandComponent ;
18481859 public data ;
18491860 public width = '500px' ;
1850-
1861+ public showAnotherCol = false ;
18511862 constructor ( ) {
18521863 // 3 level hierarchy
18531864 this . data = this . generateDataUneven ( 20 , 3 ) ;
0 commit comments