@@ -76,12 +76,12 @@ describe('Excel Exporter', () => {
7676 fix . detectChanges ( ) ;
7777
7878 let wrapper = await getExportedData ( grid , options ) ;
79- wrapper . verifyDataFilesContent ( actualData . simpleGridDataRecord5 , 'One row only should have been exported!' ) ;
79+ await wrapper . verifyDataFilesContent ( actualData . simpleGridDataRecord5 , 'One row only should have been exported!' ) ;
8080
8181 options . ignoreFiltering = true ;
8282 fix . detectChanges ( ) ;
8383 wrapper = await getExportedData ( grid , options ) ;
84- wrapper . verifyDataFilesContent ( actualData . simpleGridData , 'All 10 rows should have been exported!' ) ;
84+ await wrapper . verifyDataFilesContent ( actualData . simpleGridData , 'All 10 rows should have been exported!' ) ;
8585 } ) ;
8686
8787 it ( 'should honor filter criteria changes.' , async ( ) => {
@@ -92,14 +92,14 @@ describe('Excel Exporter', () => {
9292 options . ignoreFiltering = false ;
9393
9494 let wrapper = await getExportedData ( grid , options ) ;
95- wrapper . verifyDataFilesContent ( actualData . simpleGridDataRecord5 , 'One row should have been exported!' ) ;
95+ await wrapper . verifyDataFilesContent ( actualData . simpleGridDataRecord5 , 'One row should have been exported!' ) ;
9696
9797 grid . filter ( 'JobTitle' , 'Director' , IgxStringFilteringOperand . instance ( ) . condition ( 'equals' ) , true ) ;
9898 fix . detectChanges ( ) ;
9999
100100 expect ( grid . rowList . length ) . toEqual ( 2 , 'Invalid number of rows after filtering!' ) ;
101101 wrapper = await getExportedData ( grid , options ) ;
102- wrapper . verifyDataFilesContent ( actualData . simpleGridDataDirectors , 'Two rows should have been exported!' ) ;
102+ await wrapper . verifyDataFilesContent ( actualData . simpleGridDataDirectors , 'Two rows should have been exported!' ) ;
103103 } ) ;
104104
105105 it ( 'should honor \'ignoreColumnsVisibility\' option.' , async ( ) => {
@@ -115,12 +115,12 @@ describe('Excel Exporter', () => {
115115
116116 expect ( grid . visibleColumns . length ) . toEqual ( 2 , 'Invalid number of visible columns!' ) ;
117117 let wrapper = await getExportedData ( grid , options ) ;
118- wrapper . verifyDataFilesContent ( actualData . simpleGridNameJobTitle , 'Two columns should have been exported!' ) ;
118+ await wrapper . verifyDataFilesContent ( actualData . simpleGridNameJobTitle , 'Two columns should have been exported!' ) ;
119119
120120 options . ignoreColumnsVisibility = true ;
121121 fix . detectChanges ( ) ;
122122 wrapper = await getExportedData ( grid , options ) ;
123- wrapper . verifyDataFilesContent ( actualData . simpleGridData , 'All three columns should have been exported!' ) ;
123+ await wrapper . verifyDataFilesContent ( actualData . simpleGridData , 'All three columns should have been exported!' ) ;
124124 } ) ;
125125
126126 it ( 'should honor columns visibility changes.' , async ( ) => {
@@ -134,28 +134,28 @@ describe('Excel Exporter', () => {
134134
135135 expect ( grid . visibleColumns . length ) . toEqual ( 3 , 'Invalid number of visible columns!' ) ;
136136 let wrapper = await getExportedData ( grid , options ) ;
137- wrapper . verifyDataFilesContent ( actualData . simpleGridData , 'All columns should have been exported!' ) ;
137+ await wrapper . verifyDataFilesContent ( actualData . simpleGridData , 'All columns should have been exported!' ) ;
138138
139139 grid . columns [ 0 ] . hidden = true ;
140140 fix . detectChanges ( ) ;
141141
142142 expect ( grid . visibleColumns . length ) . toEqual ( 2 , 'Invalid number of visible columns!' ) ;
143143 wrapper = await getExportedData ( grid , options ) ;
144- wrapper . verifyDataFilesContent ( actualData . simpleGridNameJobTitle , 'Two columns should have been exported!' ) ;
144+ await wrapper . verifyDataFilesContent ( actualData . simpleGridNameJobTitle , 'Two columns should have been exported!' ) ;
145145
146146 grid . columns [ 0 ] . hidden = false ;
147147 fix . detectChanges ( ) ;
148148
149149 expect ( grid . visibleColumns . length ) . toEqual ( 3 , 'Invalid number of visible columns!' ) ;
150150 wrapper = await getExportedData ( grid , options ) ;
151- wrapper . verifyDataFilesContent ( actualData . simpleGridData , 'All columns should have been exported!' ) ;
151+ await wrapper . verifyDataFilesContent ( actualData . simpleGridData , 'All columns should have been exported!' ) ;
152152
153153 grid . columns [ 0 ] . hidden = undefined ;
154154 fix . detectChanges ( ) ;
155155
156156 expect ( grid . visibleColumns . length ) . toEqual ( 3 , 'Invalid number of visible columns!' ) ;
157157 wrapper = await getExportedData ( grid , options ) ;
158- wrapper . verifyDataFilesContent ( actualData . simpleGridData , 'All columns should have been exported!' ) ;
158+ await wrapper . verifyDataFilesContent ( actualData . simpleGridData , 'All columns should have been exported!' ) ;
159159 } ) ;
160160
161161 it ( 'should honor columns declaration order.' , async ( ) => {
@@ -166,7 +166,7 @@ describe('Excel Exporter', () => {
166166 const grid = fix . componentInstance . grid ;
167167
168168 const wrapper = await getExportedData ( grid , options ) ;
169- wrapper . verifyDataFilesContent ( actualData . simpleGridNameJobTitleID ) ;
169+ await wrapper . verifyDataFilesContent ( actualData . simpleGridNameJobTitleID ) ;
170170 } ) ;
171171
172172 it ( 'should honor \'ignorePinning\' option.' , async ( ) => {
@@ -179,13 +179,13 @@ describe('Excel Exporter', () => {
179179
180180 let wrapper = await getExportedData ( grid , options ) ;
181181 wrapper . verifyStructure ( ) ;
182- // wrapper.verifyTemplateFilesContent();
183- wrapper . verifyDataFilesContent ( actualData . gridNameFrozen , 'One frozen column should have been exported!' ) ;
182+ // await wrapper.verifyTemplateFilesContent();
183+ await wrapper . verifyDataFilesContent ( actualData . gridNameFrozen , 'One frozen column should have been exported!' ) ;
184184
185185 options . ignorePinning = true ;
186186 fix . detectChanges ( ) ;
187187 wrapper = await getExportedData ( grid , options ) ;
188- wrapper . verifyDataFilesContent ( actualData . gridNameIDJobTitle , 'No frozen columns should have been exported!' ) ;
188+ await wrapper . verifyDataFilesContent ( actualData . gridNameIDJobTitle , 'No frozen columns should have been exported!' ) ;
189189 } ) ;
190190
191191 it ( 'should honor pinned state changes.' , async ( ) => {
@@ -194,12 +194,22 @@ describe('Excel Exporter', () => {
194194 const grid = result . grid ;
195195
196196 let wrapper = await getExportedData ( grid , options ) ;
197- wrapper . verifyDataFilesContent ( actualData . gridNameFrozen , 'One frozen column should have been exported!' ) ;
197+ await wrapper . verifyDataFilesContent ( actualData . gridNameFrozen , 'One frozen column should have been exported!' ) ;
198198
199199 grid . columns [ 1 ] . pinned = false ;
200200 fix . detectChanges ( ) ;
201201 wrapper = await getExportedData ( grid , options ) ;
202- wrapper . verifyDataFilesContent ( actualData . simpleGridData , 'No frozen columns should have been exported!' ) ;
202+ await wrapper . verifyDataFilesContent ( actualData . simpleGridData , 'No frozen columns should have been exported!' ) ;
203+ } ) ;
204+
205+ it ( 'should honor all pinned columns.' , async ( ) => {
206+ const result = await TestMethods . createGridAndPinColumn ( 2 , 0 ) ;
207+ const fix = result . fixture ;
208+ const grid = result . grid ;
209+
210+ const wrapper = await getExportedData ( grid , options ) ;
211+ wrapper . verifyStructure ( ) ;
212+ await wrapper . verifyDataFilesContent ( actualData . gridJobTitleIdFrozen , 'Not all pinned columns are frozen in the export!' ) ;
203213 } ) ;
204214
205215 it ( 'should honor applied sorting.' , async ( ) => {
@@ -212,7 +222,7 @@ describe('Excel Exporter', () => {
212222 fix . detectChanges ( ) ;
213223
214224 const wrapper = await getExportedData ( grid , options ) ;
215- wrapper . verifyDataFilesContent ( actualData . simpleGridSortByName ) ;
225+ await wrapper . verifyDataFilesContent ( actualData . simpleGridSortByName ) ;
216226
217227 // XXX : ???? What's the point of this?
218228 // grid.clearSort();
@@ -229,20 +239,21 @@ describe('Excel Exporter', () => {
229239 fix . detectChanges ( ) ;
230240
231241 let wrapper = await getExportedData ( grid , options ) ;
232- wrapper . verifyDataFilesContent ( actualData . simpleGridSortByName , 'Ascending sorted data should have been exported.' ) ;
242+ await wrapper . verifyDataFilesContent ( actualData . simpleGridSortByName , 'Ascending sorted data should have been exported.' ) ;
233243
234244 grid . sort ( { fieldName : 'Name' , dir : SortingDirection . Desc , ignoreCase : true , strategy : DefaultSortingStrategy . instance ( ) } ) ;
235245 fix . detectChanges ( ) ;
236246
237247 wrapper = await getExportedData ( grid , options ) ;
238- wrapper . verifyDataFilesContent ( actualData . simpleGridSortByNameDesc ( true ) , 'Descending sorted data should have been exported.' ) ;
248+ await wrapper . verifyDataFilesContent (
249+ actualData . simpleGridSortByNameDesc ( true ) , 'Descending sorted data should have been exported.' ) ;
239250
240251 grid . clearSort ( ) ;
241252 grid . sort ( { fieldName : 'ID' , dir : SortingDirection . Asc , ignoreCase : true , strategy : DefaultSortingStrategy . instance ( ) } ) ;
242253 fix . detectChanges ( ) ;
243254
244255 // wrapper = await getExportedData(grid, options);
245- // wrapper.verifyDataFilesContent(actualData.simpleGridSortByNameDesc(false), 'Unsorted data should have been exported.');
256+ // await wrapper.verifyDataFilesContent(actualData.simpleGridSortByNameDesc(false), 'Unsorted data should have been exported.');
246257 } ) ;
247258
248259 it ( 'should export all columns with the width specified in options.' , async ( ) => {
@@ -323,7 +334,7 @@ describe('Excel Exporter', () => {
323334 expect ( cols [ 0 ] . index ) . toBe ( 0 ) ;
324335 expect ( cols [ 1 ] . header ) . toBe ( 'JobTitle' ) ;
325336 expect ( cols [ 1 ] . index ) . toBe ( 1 ) ;
326- wrapper . verifyDataFilesContent ( actualData . simpleGridNameJobTitle ) ;
337+ await wrapper . verifyDataFilesContent ( actualData . simpleGridNameJobTitle ) ;
327338 } ) ;
328339
329340 it ( 'should not export columns when \'onColumnExport\' is canceled.' , async ( ) => {
@@ -340,7 +351,7 @@ describe('Excel Exporter', () => {
340351 const wrapper = await getExportedData ( grid , options ) ;
341352 expect ( wrapper . hasValues ) . toBe ( false ) ;
342353 wrapper . verifyStructure ( ) ;
343- wrapper . verifyTemplateFilesContent ( ) ;
354+ await wrapper . verifyTemplateFilesContent ( ) ;
344355 } ) ;
345356
346357 it ( 'should fire \'onRowExport\' for each grid row.' , async ( ) => {
@@ -378,7 +389,7 @@ describe('Excel Exporter', () => {
378389 const wrapper = await getExportedData ( grid , options ) ;
379390 expect ( wrapper . hasValues ) . toBe ( false ) ;
380391 wrapper . verifyStructure ( ) ;
381- wrapper . verifyTemplateFilesContent ( ) ;
392+ await wrapper . verifyTemplateFilesContent ( ) ;
382393 } ) ;
383394
384395 it ( 'shouldn\'t affect grid sort expressions' , async ( ) => {
0 commit comments