@@ -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 ( ) ;
@@ -518,6 +521,49 @@ describe('CSV Grid Exporter', () => {
518521 } ) ;
519522 } ) ;
520523
524+ describe ( 'Pivot Grid CSV export' , ( ) => {
525+ let fix ;
526+ let pivotGrid : IgxPivotGridComponent ;
527+ beforeEach ( ( ) => {
528+ fix = TestBed . createComponent ( IgxPivotGridTestBaseComponent ) ;
529+ fix . detectChanges ( ) ;
530+ pivotGrid = fix . componentInstance . pivotGrid ;
531+ pivotGrid . pivotConfiguration = {
532+ columns : [
533+ {
534+ enabled : true ,
535+ memberName : 'Country'
536+ }
537+ ] ,
538+ rows : [
539+ {
540+ enabled : true ,
541+ memberName : 'ProductCategory'
542+ }
543+ ] ,
544+ values : [
545+ {
546+ enabled : true ,
547+ member : 'UnitsSold' ,
548+ aggregate : {
549+ aggregator : IgxPivotNumericAggregate . sum ,
550+ key : 'SUM' ,
551+ label : 'Sum' ,
552+ } ,
553+ }
554+ ]
555+ } ;
556+ fix . detectChanges ( ) ;
557+ } ) ;
558+
559+ it ( 'should export pivot grid successfully.' , async ( ) => {
560+ await wait ( ) ;
561+ debugger
562+ const wrapper = await getExportedData ( pivotGrid , options ) ;
563+ wrapper . verifyData ( wrapper . pivotGridData ) ;
564+ } ) ;
565+ } ) ;
566+
521567 const getExportedData = ( grid , csvOptions : IgxCsvExporterOptions ) => {
522568 const result = new Promise < CSVWrapper > ( ( resolve ) => {
523569 exporter . exportEnded . pipe ( first ( ) ) . subscribe ( ( value ) => {
0 commit comments