@@ -4,6 +4,7 @@ import { By } from '@angular/platform-browser';
44import { NoopAnimationsModule } from '@angular/platform-browser/animations' ;
55import { first } from 'rxjs/operators' ;
66import { IgxCsvExporterOptions , IgxCsvExporterService , IgxExcelExporterOptions , IgxExcelExporterService } from '../../services/index' ;
7+ import { IgxButtonDirective } from '../../directives/button/button.directive' ;
78import { IgxGridComponent } from './grid.component' ;
89import { IgxGridModule } from './index' ;
910import { DisplayDensity } from '../../core/displayDensity' ;
@@ -582,6 +583,28 @@ describe('IgxGrid - Grid Toolbar Custom Content', () => {
582583 expect ( customContainer ) . not . toBe ( null ) ;
583584 } ) ;
584585
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+
585608} ) ;
586609
587610function getToolbar ( fixture ) {
0 commit comments