@@ -4,7 +4,8 @@ import { TestBed, fakeAsync, tick, waitForAsync } from '@angular/core/testing';
44import { DebugElement } from '@angular/core' ;
55import { GridFunctions , GridSummaryFunctions } from '../../../test-utils/grid-functions.spec' ;
66import {
7- IgxAddRowComponent , IgxGridRowEditingDefinedColumnsComponent , IgxGridRowEditingTransactionComponent
7+ IgxAddRowComponent , IgxGridRowEditingDefinedColumnsComponent , IgxGridRowEditingTransactionComponent ,
8+ GridDynamicActionStripComponent
89} from '../../../test-utils/grid-samples.spec' ;
910
1011import { By } from '@angular/platform-browser' ;
@@ -45,7 +46,8 @@ describe('IgxGrid - Row Adding #grid', () => {
4546 IgxGridRowEditingTransactionComponent ,
4647 IgxGridRowEditingDefinedColumnsComponent ,
4748 ColumnLayoutTestComponent ,
48- DefaultGridMasterDetailComponent
49+ DefaultGridMasterDetailComponent ,
50+ GridDynamicActionStripComponent
4951 ] ,
5052 providers : [
5153 IgxGridMRLNavigationService
@@ -1121,4 +1123,28 @@ describe('IgxGrid - Row Adding #grid', () => {
11211123 expect ( grid . rowChangesCount ) . toEqual ( 3 ) ;
11221124 } ) ;
11231125 } ) ;
1126+
1127+ describe ( 'ActionStrip - Dynamic Addition' , ( ) => {
1128+ beforeEach ( ( ) => {
1129+ fixture = TestBed . createComponent ( GridDynamicActionStripComponent ) ;
1130+ fixture . detectChanges ( ) ;
1131+ grid = fixture . componentInstance . grid ;
1132+ } ) ;
1133+
1134+ it ( 'Should set outlet for actionstrip menu when added post-init' , async ( ) => {
1135+ // Verify no actionstrip initially
1136+ expect ( fixture . componentInstance . actionStrip ) . toBeUndefined ( ) ;
1137+ expect ( grid . actionStrip ) . toBeUndefined ( ) ;
1138+
1139+ // Add the actionstrip dynamically
1140+ fixture . componentInstance . showActionStrip = true ;
1141+ fixture . detectChanges ( ) ;
1142+ await wait ( 16 ) ;
1143+
1144+ // Get reference to the actionstrip
1145+ actionStrip = fixture . componentInstance . actionStrip ;
1146+ expect ( actionStrip ) . toBeDefined ( ) ;
1147+ expect ( grid . actionStrip ) . toBeDefined ( ) ;
1148+ } ) ;
1149+ } ) ;
11241150} ) ;
0 commit comments