@@ -20,7 +20,12 @@ import {
20
20
GridWithThreeLevelsOfMultiColumnHeadersAndTwoRowsExportComponent ,
21
21
GroupedGridWithSummariesComponent ,
22
22
GridCurrencySummariesComponent ,
23
- GridUserMeetingDataComponent
23
+ GridUserMeetingDataComponent ,
24
+ GridCustomSummaryComponent ,
25
+ GridCustomSummaryWithNullAndZeroComponent ,
26
+ GridCustomSummaryWithUndefinedZeroAndValidNumberComponent ,
27
+ GridCustomSummaryWithUndefinedAndNullComponent ,
28
+ GridCustomSummaryWithDateComponent
24
29
} from '../../test-utils/grid-samples.spec' ;
25
30
import { SampleTestData } from '../../test-utils/sample-test-data.spec' ;
26
31
import { first } from 'rxjs/operators' ;
@@ -75,7 +80,12 @@ describe('Excel Exporter', () => {
75
80
IgxHierarchicalGridSummariesExportComponent ,
76
81
GroupedGridWithSummariesComponent ,
77
82
GridCurrencySummariesComponent ,
78
- GridUserMeetingDataComponent
83
+ GridUserMeetingDataComponent ,
84
+ GridCustomSummaryComponent ,
85
+ GridCustomSummaryWithNullAndZeroComponent ,
86
+ GridCustomSummaryWithUndefinedZeroAndValidNumberComponent ,
87
+ GridCustomSummaryWithUndefinedAndNullComponent ,
88
+ GridCustomSummaryWithDateComponent
79
89
]
80
90
} ) . compileComponents ( ) ;
81
91
} ) ) ;
@@ -1355,6 +1365,58 @@ describe('Excel Exporter', () => {
1355
1365
1356
1366
await exportAndVerify ( grid , options , actualData . exportHierarchicalGridWithSummaries ) ;
1357
1367
} ) ;
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
+ } ) ;
1418
+
1419
+
1358
1420
} ) ;
1359
1421
1360
1422
describe ( '' , ( ) => {
0 commit comments