@@ -22,6 +22,9 @@ import { FilteringLogic } from '../../data-operations/filtering-expression.inter
2222import { configureTestSuite } from '../../test-utils/configure-suite' ;
2323import { NoopAnimationsModule } from '@angular/platform-browser/animations' ;
2424import { wait } from '../../test-utils/ui-interactions.spec' ;
25+ import { IgxPivotGridComponent } from '../../grids/pivot-grid/pivot-grid.component' ;
26+ import { IgxPivotGridTestBaseComponent } from '../../test-utils/pivot-grid-samples.spec' ;
27+ import { IgxPivotNumericAggregate } from '../../grids/pivot-grid/pivot-grid-aggregate' ;
2528
2629describe ( 'CSV Grid Exporter' , ( ) => {
2730 configureTestSuite ( ) ;
@@ -513,6 +516,49 @@ describe('CSV Grid Exporter', () => {
513516 } ) ;
514517 } ) ;
515518
519+ describe ( 'Pivot Grid CSV export' , ( ) => {
520+ let fix ;
521+ let pivotGrid : IgxPivotGridComponent ;
522+ beforeEach ( ( ) => {
523+ fix = TestBed . createComponent ( IgxPivotGridTestBaseComponent ) ;
524+ fix . detectChanges ( ) ;
525+ pivotGrid = fix . componentInstance . pivotGrid ;
526+ pivotGrid . pivotConfiguration = {
527+ columns : [
528+ {
529+ enabled : true ,
530+ memberName : 'Country'
531+ }
532+ ] ,
533+ rows : [
534+ {
535+ enabled : true ,
536+ memberName : 'ProductCategory'
537+ }
538+ ] ,
539+ values : [
540+ {
541+ enabled : true ,
542+ member : 'UnitsSold' ,
543+ aggregate : {
544+ aggregator : IgxPivotNumericAggregate . sum ,
545+ key : 'SUM' ,
546+ label : 'Sum' ,
547+ } ,
548+ }
549+ ]
550+ } ;
551+ fix . detectChanges ( ) ;
552+ } ) ;
553+
554+ it ( 'should export pivot grid successfully.' , async ( ) => {
555+ await wait ( ) ;
556+ debugger
557+ const wrapper = await getExportedData ( pivotGrid , options ) ;
558+ wrapper . verifyData ( wrapper . pivotGridData ) ;
559+ } ) ;
560+ } ) ;
561+
516562 const getExportedData = ( grid , csvOptions : IgxCsvExporterOptions ) => {
517563 const result = new Promise < CSVWrapper > ( ( resolve ) => {
518564 exporter . exportEnded . pipe ( first ( ) ) . subscribe ( ( value ) => {
0 commit comments