File tree Expand file tree Collapse file tree 1 file changed +12
-7
lines changed
projects/igniteui-angular/grids/core/src/services/pdf Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -143,20 +143,25 @@ describe('PDF Exporter', () => {
143143 const pageSizes = [ 'a3' , 'a5' , 'legal' ] ;
144144 let completed = 0 ;
145145
146- pageSizes . forEach ( size => {
146+ const exportNext = ( index : number ) => {
147+ if ( index >= pageSizes . length ) {
148+ expect ( ExportUtilities . saveBlobToFile ) . toHaveBeenCalledTimes ( pageSizes . length ) ;
149+ done ( ) ;
150+ return ;
151+ }
152+
147153 const opts = new IgxPdfExporterOptions ( 'Test' ) ;
148- opts . pageSize = size as any ;
154+ opts . pageSize = pageSizes [ index ] as any ;
149155
150156 exporter . exportEnded . pipe ( first ( ) ) . subscribe ( ( ) => {
151157 completed ++ ;
152- if ( completed === pageSizes . length ) {
153- expect ( ExportUtilities . saveBlobToFile ) . toHaveBeenCalledTimes ( pageSizes . length ) ;
154- done ( ) ;
155- }
158+ exportNext ( completed ) ;
156159 } ) ;
157160
158161 exporter . exportData ( SampleTestData . contactsData ( ) , opts ) ;
159- } ) ;
162+ } ;
163+
164+ exportNext ( 0 ) ;
160165 } ) ;
161166
162167 it ( 'should export with different font sizes' , ( done ) => {
You can’t perform that action at this time.
0 commit comments