@@ -20,7 +20,12 @@ import {
2020 GridWithThreeLevelsOfMultiColumnHeadersAndTwoRowsExportComponent ,
2121 GroupedGridWithSummariesComponent ,
2222 GridCurrencySummariesComponent ,
23- GridUserMeetingDataComponent
23+ GridUserMeetingDataComponent ,
24+ GridCustomSummaryComponent ,
25+ GridCustomSummaryWithNullAndZeroComponent ,
26+ GridCustomSummaryWithUndefinedZeroAndValidNumberComponent ,
27+ GridCustomSummaryWithUndefinedAndNullComponent ,
28+ GridCustomSummaryWithDateComponent
2429} from '../../test-utils/grid-samples.spec' ;
2530import { SampleTestData } from '../../test-utils/sample-test-data.spec' ;
2631import { first } from 'rxjs/operators' ;
@@ -75,7 +80,12 @@ describe('Excel Exporter', () => {
7580 IgxHierarchicalGridSummariesExportComponent ,
7681 GroupedGridWithSummariesComponent ,
7782 GridCurrencySummariesComponent ,
78- GridUserMeetingDataComponent
83+ GridUserMeetingDataComponent ,
84+ GridCustomSummaryComponent ,
85+ GridCustomSummaryWithNullAndZeroComponent ,
86+ GridCustomSummaryWithUndefinedZeroAndValidNumberComponent ,
87+ GridCustomSummaryWithUndefinedAndNullComponent ,
88+ GridCustomSummaryWithDateComponent
7989 ]
8090 } ) . compileComponents ( ) ;
8191 } ) ) ;
@@ -1355,6 +1365,56 @@ describe('Excel Exporter', () => {
13551365
13561366 await exportAndVerify ( grid , options , actualData . exportHierarchicalGridWithSummaries ) ;
13571367 } ) ;
1368+
1369+ it ( 'should export grid with custom summaries, only with summary label as string' , async ( ) => {
1370+ fix = TestBed . createComponent ( GridCustomSummaryComponent ) ;
1371+ fix . detectChanges ( ) ;
1372+ await wait ( 300 ) ;
1373+
1374+ grid = fix . componentInstance . grid ;
1375+
1376+ await exportAndVerify ( grid , options , actualData . exportGridWithCustomSummaryOnlyWithSummaryLabel ) ;
1377+ } ) ;
1378+
1379+ it ( 'should export grid with custom summaries, with null and zero (as number)' , async ( ) => {
1380+ fix = TestBed . createComponent ( GridCustomSummaryWithNullAndZeroComponent ) ;
1381+ fix . detectChanges ( ) ;
1382+ await wait ( 300 ) ;
1383+
1384+ grid = fix . componentInstance . grid ;
1385+
1386+ await exportAndVerify ( grid , options , actualData . exportGridCustomSummaryWithNullAndZero ) ;
1387+ } ) ;
1388+
1389+ it ( 'should export grid with custom summaries, with undefined, zero and positive number (as number)' , async ( ) => {
1390+ fix = TestBed . createComponent ( GridCustomSummaryWithUndefinedZeroAndValidNumberComponent ) ;
1391+ fix . detectChanges ( ) ;
1392+ await wait ( 300 ) ;
1393+
1394+ grid = fix . componentInstance . grid ;
1395+
1396+ await exportAndVerify ( grid , options , actualData . exportGridCustomSummaryWithUndefinedZeroAndValidNumber ) ;
1397+ } ) ;
1398+
1399+ it ( 'should export grid with custom summaries, with undefined and null' , async ( ) => {
1400+ fix = TestBed . createComponent ( GridCustomSummaryWithUndefinedAndNullComponent ) ;
1401+ fix . detectChanges ( ) ;
1402+ await wait ( 300 ) ;
1403+
1404+ grid = fix . componentInstance . grid ;
1405+
1406+ await exportAndVerify ( grid , options , actualData . exportGridCustomSummaryWithUndefinedAndNull ) ;
1407+ } ) ;
1408+
1409+ it ( 'should export grid with custom summaries, with date' , async ( ) => {
1410+ fix = TestBed . createComponent ( GridCustomSummaryWithDateComponent ) ;
1411+ fix . detectChanges ( ) ;
1412+ await wait ( 300 ) ;
1413+
1414+ grid = fix . componentInstance . grid ;
1415+
1416+ await exportAndVerify ( grid , options , actualData . exportGridCustomSummaryWithDate ) ;
1417+ } ) ;
13581418 } ) ;
13591419
13601420 describe ( '' , ( ) => {
0 commit comments