File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
frontend/src/app/utils/__tests__ Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -468,5 +468,30 @@ describe('Chart Helper ', () => {
468468 ) . toEqual ( 1 ) ;
469469 expect ( chartDataSet [ 0 ] . getCellByKey ( 'AVG(age)' ) ) . toEqual ( 'r1-c2-v' ) ;
470470 } ) ;
471+
472+ test ( 'should get dataset row data with case sensitive' , ( ) => {
473+ const columns = [ [ 'r1-c1-v' , 'r1-c2-v' ] ] ;
474+ const metas = [ { name : 'name' } , { name : 'avg(age)' } ] ;
475+ const chartDataSet = transformToDataSet ( columns , metas , [
476+ {
477+ rows : [
478+ {
479+ colName : 'Name' ,
480+ } ,
481+ {
482+ colName : 'Age' ,
483+ aggregate : 'AVG' ,
484+ } ,
485+ ] ,
486+ } ,
487+ ] as any ) ;
488+
489+ expect ( chartDataSet ?. length ) . toEqual ( 1 ) ;
490+ expect ( chartDataSet [ 0 ] instanceof ChartDataSetRow ) . toBeTruthy ( ) ;
491+ expect ( chartDataSet [ 0 ] . convertToCaseSensitiveObject ( ) ) . toEqual ( {
492+ Name : 'r1-c1-v' ,
493+ 'AVG(Age)' : 'r1-c2-v' ,
494+ } ) ;
495+ } ) ;
471496 } ) ;
472497} ) ;
You can’t perform that action at this time.
0 commit comments