@@ -4,6 +4,7 @@ import { By } from '@angular/platform-browser';
4
4
import { NoopAnimationsModule } from '@angular/platform-browser/animations' ;
5
5
import { first } from 'rxjs/operators' ;
6
6
import { IgxCsvExporterOptions , IgxCsvExporterService , IgxExcelExporterOptions , IgxExcelExporterService } from '../../services/index' ;
7
+ import { IgxButtonDirective } from '../../directives/button/button.directive' ;
7
8
import { IgxGridComponent } from './grid.component' ;
8
9
import { IgxGridModule } from './index' ;
9
10
import { DisplayDensity } from '../../core/displayDensity' ;
@@ -582,6 +583,28 @@ describe('IgxGrid - Grid Toolbar Custom Content', () => {
582
583
expect ( customContainer ) . not . toBe ( null ) ;
583
584
} ) ;
584
585
586
+ it ( 'should expose the toolbar buttons with their correct type' , ( ) => {
587
+ fixture = TestBed . createComponent ( GridToolbarTestPage1Component ) ;
588
+ fixture . detectChanges ( ) ;
589
+ grid = fixture . componentInstance . grid1 ;
590
+
591
+ grid . showToolbar = true ;
592
+ grid . columnHiding = true ;
593
+ grid . columnPinning = true ;
594
+ grid . exportExcel = true ;
595
+ grid . exportCsv = true ;
596
+ fixture . detectChanges ( ) ;
597
+
598
+ let aButton = grid . toolbar . columnHidingButton ;
599
+ expect ( aButton instanceof IgxButtonDirective ) . toBe ( true , 'column hiding button has wrong type' ) ;
600
+
601
+ aButton = grid . toolbar . columnPinningButton ;
602
+ expect ( aButton instanceof IgxButtonDirective ) . toBe ( true , 'column pinning button has wrong type' ) ;
603
+
604
+ aButton = grid . toolbar . exportButton ;
605
+ expect ( aButton instanceof IgxButtonDirective ) . toBe ( true , 'export button has wrong type' ) ;
606
+ } ) ;
607
+
585
608
} ) ;
586
609
587
610
function getToolbar ( fixture ) {
0 commit comments