@@ -34,7 +34,7 @@ describe('ui.grid.exporter', function() {
3434
3535 grid = gridClassFactory . createGrid ( { } ) ;
3636 grid . options . columnDefs = [
37- { field : 'col1' , name : 'col1' , displayName : 'Col1' , width : 50 , pinnedLeft : true } ,
37+ { field : 'col1' , name : 'col1' , displayName : 'Col1' , width : 50 , headerCellFilter : 'uppercase' , pinnedLeft : true } ,
3838 { field : 'col2' , name : 'col2' , displayName : 'Col2' , width : '*' , type : 'number' , cellFilter : 'uppercase' } ,
3939 { field : 'col3' , name : 'col3' , displayName : 'Col3' , width : 100 } ,
4040 { field : 'col4' , name : 'col4' , displayName : 'Col4' , width : 200 }
@@ -115,49 +115,6 @@ describe('ui.grid.exporter', function() {
115115 } ) ;
116116 } ) ;
117117
118- describe ( 'defaultGridOptions' , function ( ) {
119- var options ;
120-
121- beforeEach ( function ( ) {
122- options = { } ;
123- } ) ;
124-
125- it ( 'set all options to default' , function ( ) {
126- uiGridExporterService . defaultGridOptions ( options ) ;
127- expect ( options ) . toEqual ( {
128- exporterSuppressMenu : false ,
129- exporterMenuLabel : 'Export' ,
130- exporterCsvColumnSeparator : ',' ,
131- exporterCsvFilename : 'download.csv' ,
132- exporterPdfFilename : 'download.pdf' ,
133- exporterOlderExcelCompatibility : false ,
134- exporterIsExcelCompatible : false ,
135- exporterPdfDefaultStyle : { fontSize : 11 } ,
136- exporterPdfTableStyle : { margin : [ 0 , 5 , 0 , 15 ] } ,
137- exporterPdfTableHeaderStyle : { bold : true , fontSize : 12 , color : 'black' } ,
138- exporterPdfHeader : null ,
139- exporterPdfFooter : null ,
140- exporterPdfOrientation : 'landscape' ,
141- exporterPdfPageSize : 'A4' ,
142- exporterPdfMaxGridWidth : 720 ,
143- exporterPdfCustomFormatter : jasmine . any ( Function ) ,
144- exporterHeaderFilterUseName : false ,
145- exporterMenuAllData : true ,
146- exporterMenuVisibleData : true ,
147- exporterMenuSelectedData : true ,
148- exporterMenuCsv : true ,
149- exporterMenuPdf : true ,
150- exporterMenuExcel : true ,
151- exporterFieldCallback : jasmine . any ( Function ) ,
152- exporterFieldFormatCallback : jasmine . any ( Function ) ,
153- exporterFieldApplyFilters : false ,
154- exporterAllDataFn : null ,
155- exporterSuppressColumns : [ ] ,
156- exporterMenuItemOrder : 200
157- } ) ;
158- } ) ;
159- } ) ;
160-
161118 describe ( 'defaultGridOptions' , function ( ) {
162119 var options ;
163120
@@ -781,15 +738,15 @@ describe('ui.grid.exporter', function() {
781738 describe ( 'getColumnHeaders' , function ( ) {
782739 it ( 'gets visible headers' , function ( ) {
783740 expect ( uiGridExporterService . getColumnHeaders ( grid , uiGridExporterConstants . VISIBLE ) ) . toEqual ( [
784- { name : 'col1' , displayName : 'Col1 ' , width : 50 , align : 'left' } ,
741+ { name : 'col1' , displayName : 'COL1 ' , width : 50 , align : 'left' } ,
785742 { name : 'col2' , displayName : 'Col2' , width : '*' , align : 'right' } ,
786743 { name : 'col4' , displayName : 'Col4' , width : 200 , align : 'left' }
787744 ] ) ;
788745 } ) ;
789746
790747 it ( 'gets all headers' , function ( ) {
791748 expect ( uiGridExporterService . getColumnHeaders ( grid , uiGridExporterConstants . ALL ) ) . toEqual ( [
792- { name : 'col1' , displayName : 'Col1 ' , width : 50 , align : 'left' } ,
749+ { name : 'col1' , displayName : 'COL1 ' , width : 50 , align : 'left' } ,
793750 { name : 'col2' , displayName : 'Col2' , width : '*' , align : 'right' } ,
794751 { name : 'col3' , displayName : 'Col3' , width : 100 , align : 'left' } ,
795752 { name : 'col4' , displayName : 'Col4' , width : 200 , align : 'left' }
@@ -889,48 +846,48 @@ describe('ui.grid.exporter', function() {
889846 describe ( 'getData' , function ( ) {
890847 it ( 'gets all rows and columns' , function ( ) {
891848 expect ( uiGridExporterService . getData ( grid , uiGridExporterConstants . ALL , uiGridExporterConstants . ALL ) ) . toEqual ( [
892- [ { value : 'a_0' } , { value : 'b_0 ' } , { value : 'c_0' } , { value : 'd_0' } ] ,
893- [ { value : 'a_1' } , { value : 'b_1 ' } , { value : 'c_1' } , { value : 'd_1' } ] ,
894- [ { value : 'a_2' } , { value : 'b_2 ' } , { value : 'c_2' } , { value : 'd_2' } ]
849+ [ { value : 'a_0' } , { value : 'B_0 ' } , { value : 'c_0' } , { value : 'd_0' } ] ,
850+ [ { value : 'a_1' } , { value : 'B_1 ' } , { value : 'c_1' } , { value : 'd_1' } ] ,
851+ [ { value : 'a_2' } , { value : 'B_2 ' } , { value : 'c_2' } , { value : 'd_2' } ]
895852 ] ) ;
896853 } ) ;
897854
898855 it ( 'ignores selection row header column' , function ( ) {
899856 grid . columns [ 0 ] . colDef . exporterSuppressExport = true ;
900857 expect ( uiGridExporterService . getData ( grid , uiGridExporterConstants . ALL , uiGridExporterConstants . ALL ) ) . toEqual ( [
901- [ { value : 'b_0 ' } , { value : 'c_0' } , { value : 'd_0' } ] ,
902- [ { value : 'b_1 ' } , { value : 'c_1' } , { value : 'd_1' } ] ,
903- [ { value : 'b_2 ' } , { value : 'c_2' } , { value : 'd_2' } ]
858+ [ { value : 'B_0 ' } , { value : 'c_0' } , { value : 'd_0' } ] ,
859+ [ { value : 'B_1 ' } , { value : 'c_1' } , { value : 'd_1' } ] ,
860+ [ { value : 'B_2 ' } , { value : 'c_2' } , { value : 'd_2' } ]
904861 ] ) ;
905862 } ) ;
906863
907864 it ( 'ignores suppressed column' , function ( ) {
908865 grid . options . exporterSuppressColumns = [ 'col1' ] ;
909866 expect ( uiGridExporterService . getData ( grid , uiGridExporterConstants . ALL , uiGridExporterConstants . ALL ) ) . toEqual ( [
910- [ { value : 'b_0 ' } , { value : 'c_0' } , { value : 'd_0' } ] ,
911- [ { value : 'b_1 ' } , { value : 'c_1' } , { value : 'd_1' } ] ,
912- [ { value : 'b_2 ' } , { value : 'c_2' } , { value : 'd_2' } ]
867+ [ { value : 'B_0 ' } , { value : 'c_0' } , { value : 'd_0' } ] ,
868+ [ { value : 'B_1 ' } , { value : 'c_1' } , { value : 'd_1' } ] ,
869+ [ { value : 'B_2 ' } , { value : 'c_2' } , { value : 'd_2' } ]
913870 ] ) ;
914871 } ) ;
915872
916873 it ( 'ignores disabled row' , function ( ) {
917874 grid . rows [ 1 ] . exporterEnableExporting = false ;
918875 expect ( uiGridExporterService . getData ( grid , uiGridExporterConstants . ALL , uiGridExporterConstants . ALL ) ) . toEqual ( [
919- [ { value : 'a_0' } , { value : 'b_0 ' } , { value : 'c_0' } , { value : 'd_0' } ] ,
920- [ { value : 'a_2' } , { value : 'b_2 ' } , { value : 'c_2' } , { value : 'd_2' } ]
876+ [ { value : 'a_0' } , { value : 'B_0 ' } , { value : 'c_0' } , { value : 'd_0' } ] ,
877+ [ { value : 'a_2' } , { value : 'B_2 ' } , { value : 'c_2' } , { value : 'd_2' } ]
921878 ] ) ;
922879 } ) ;
923880
924881 it ( 'gets visible rows and columns' , function ( ) {
925882 expect ( uiGridExporterService . getData ( grid , uiGridExporterConstants . VISIBLE , uiGridExporterConstants . VISIBLE ) ) . toEqual ( [
926- [ { value : 'a_0' } , { value : 'b_0 ' } , { value : 'd_0' } ] ,
927- [ { value : 'a_2' } , { value : 'b_2 ' } , { value : 'd_2' } ]
883+ [ { value : 'a_0' } , { value : 'B_0 ' } , { value : 'd_0' } ] ,
884+ [ { value : 'a_2' } , { value : 'B_2 ' } , { value : 'd_2' } ]
928885 ] ) ;
929886 } ) ;
930887
931888 it ( 'gets selected rows and visible columns' , function ( ) {
932889 expect ( uiGridExporterService . getData ( grid , uiGridExporterConstants . SELECTED , uiGridExporterConstants . VISIBLE ) ) . toEqual ( [
933- [ { value : 'a_0' } , { value : 'b_0 ' } , { value : 'd_0' } ]
890+ [ { value : 'a_0' } , { value : 'B_0 ' } , { value : 'd_0' } ]
934891 ] ) ;
935892 } ) ;
936893
0 commit comments