@@ -34,7 +34,7 @@ describe('ui.grid.exporter', function() {
34
34
35
35
grid = gridClassFactory . createGrid ( { } ) ;
36
36
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 } ,
38
38
{ field : 'col2' , name : 'col2' , displayName : 'Col2' , width : '*' , type : 'number' , cellFilter : 'uppercase' } ,
39
39
{ field : 'col3' , name : 'col3' , displayName : 'Col3' , width : 100 } ,
40
40
{ field : 'col4' , name : 'col4' , displayName : 'Col4' , width : 200 }
@@ -115,49 +115,6 @@ describe('ui.grid.exporter', function() {
115
115
} ) ;
116
116
} ) ;
117
117
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
-
161
118
describe ( 'defaultGridOptions' , function ( ) {
162
119
var options ;
163
120
@@ -781,15 +738,15 @@ describe('ui.grid.exporter', function() {
781
738
describe ( 'getColumnHeaders' , function ( ) {
782
739
it ( 'gets visible headers' , function ( ) {
783
740
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' } ,
785
742
{ name : 'col2' , displayName : 'Col2' , width : '*' , align : 'right' } ,
786
743
{ name : 'col4' , displayName : 'Col4' , width : 200 , align : 'left' }
787
744
] ) ;
788
745
} ) ;
789
746
790
747
it ( 'gets all headers' , function ( ) {
791
748
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' } ,
793
750
{ name : 'col2' , displayName : 'Col2' , width : '*' , align : 'right' } ,
794
751
{ name : 'col3' , displayName : 'Col3' , width : 100 , align : 'left' } ,
795
752
{ name : 'col4' , displayName : 'Col4' , width : 200 , align : 'left' }
@@ -889,48 +846,48 @@ describe('ui.grid.exporter', function() {
889
846
describe ( 'getData' , function ( ) {
890
847
it ( 'gets all rows and columns' , function ( ) {
891
848
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' } ]
895
852
] ) ;
896
853
} ) ;
897
854
898
855
it ( 'ignores selection row header column' , function ( ) {
899
856
grid . columns [ 0 ] . colDef . exporterSuppressExport = true ;
900
857
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' } ]
904
861
] ) ;
905
862
} ) ;
906
863
907
864
it ( 'ignores suppressed column' , function ( ) {
908
865
grid . options . exporterSuppressColumns = [ 'col1' ] ;
909
866
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' } ]
913
870
] ) ;
914
871
} ) ;
915
872
916
873
it ( 'ignores disabled row' , function ( ) {
917
874
grid . rows [ 1 ] . exporterEnableExporting = false ;
918
875
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' } ]
921
878
] ) ;
922
879
} ) ;
923
880
924
881
it ( 'gets visible rows and columns' , function ( ) {
925
882
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' } ]
928
885
] ) ;
929
886
} ) ;
930
887
931
888
it ( 'gets selected rows and visible columns' , function ( ) {
932
889
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' } ]
934
891
] ) ;
935
892
} ) ;
936
893
0 commit comments