@datarailsshared/dr_renderer 1.2.410 → 1.2.412
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/highcharts_renderer.js +26 -35
- package/tests/highcharts_renderer.test.js +167 -358
package/package.json
CHANGED
@@ -149,7 +149,6 @@ const CHART_LEGEND_DEFAULT_LABEL = 'Legend (Series)';
|
|
149
149
|
|
150
150
|
const FEATURES = {
|
151
151
|
ENABLE_NEW_WIDGET_VALUE_FORMATTING: 'enable_new_widget_value_formatting',
|
152
|
-
FORMAT_AXIS: 'use_default_table_format_for_axis',
|
153
152
|
FORMAT_DATES_AS_OTHER_AXIS_TYPES: 'format_dates_as_other_axis_types',
|
154
153
|
MULTIPLE_DIMENSION_TAGS: 'multiple_dimension_tags',
|
155
154
|
USE_NEW_SCENARIO_TAG: 'use_new_scenario_tag',
|
@@ -580,7 +579,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
580
579
|
var func = function () {
|
581
580
|
var value = parseFloat(this.y);
|
582
581
|
if (pivotData) {
|
583
|
-
let series_name = highchartsRenderer.getSeriesNameInFormatterContext(this
|
582
|
+
let series_name = highchartsRenderer.getSeriesNameInFormatterContext(this);
|
584
583
|
var rows = series_name.split(highchartsRenderer.delimer);
|
585
584
|
|
586
585
|
if (is_drill_down_pie && highchartsRenderer.selfStartsWith(series_name, "Series ")) {
|
@@ -593,7 +592,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
593
592
|
rows = [];
|
594
593
|
}
|
595
594
|
|
596
|
-
var cols = highchartsRenderer.getColsInFormatterContext(this
|
595
|
+
var cols = highchartsRenderer.getColsInFormatterContext(this);
|
597
596
|
if (typeof (cols) == 'object' && cols.name) {
|
598
597
|
cols = cols.name;
|
599
598
|
}
|
@@ -737,7 +736,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
737
736
|
|
738
737
|
var y = parseFloat(this.y);
|
739
738
|
if (pivotData) {
|
740
|
-
let series_name = highchartsRenderer.getSeriesNameInFormatterContext(this
|
739
|
+
let series_name = highchartsRenderer.getSeriesNameInFormatterContext(this);
|
741
740
|
var rows = series_name.split(highchartsRenderer.delimer);
|
742
741
|
if (is_drill_down_pie && highchartsRenderer.selfStartsWith(series_name,"Series ")) {
|
743
742
|
rows = [];
|
@@ -748,7 +747,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
748
747
|
rows = [];
|
749
748
|
}
|
750
749
|
|
751
|
-
var cols = highchartsRenderer.getColsInFormatterContext(this
|
750
|
+
var cols = highchartsRenderer.getColsInFormatterContext(this);
|
752
751
|
if (!cols && is_drill_down_pie) {
|
753
752
|
cols = this.name;
|
754
753
|
}
|
@@ -775,7 +774,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
775
774
|
? isWaterfallWalkthrough
|
776
775
|
? this.key
|
777
776
|
: cols[0]
|
778
|
-
:
|
777
|
+
: lodash.get(this, 'point.name') || cols
|
779
778
|
);
|
780
779
|
|
781
780
|
highchartsRenderer.replaceDrOthersKeys(cols, rows, drOthersInAxis, othersName);
|
@@ -3003,7 +3002,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
3003
3002
|
zoomType: additionOptions && additionOptions.chart && additionOptions.chart.zoom_type ? additionOptions.chart.zoom_type : 'None',
|
3004
3003
|
events: {
|
3005
3004
|
'drilldown': function (e) {
|
3006
|
-
highchartsRenderer.modifyEventPointForDrilldown(e
|
3005
|
+
highchartsRenderer.modifyEventPointForDrilldown(e);
|
3007
3006
|
if (drilldownFunc)
|
3008
3007
|
drilldownFunc(e, this, "drilldown");
|
3009
3008
|
|
@@ -3115,7 +3114,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
3115
3114
|
zoomType: 'x',
|
3116
3115
|
events: {
|
3117
3116
|
'drilldown': function (e) {
|
3118
|
-
highchartsRenderer.modifyEventPointForDrilldown(e
|
3117
|
+
highchartsRenderer.modifyEventPointForDrilldown(e);
|
3119
3118
|
if (drilldownFunc)
|
3120
3119
|
drilldownFunc(e, this, "drilldown");
|
3121
3120
|
|
@@ -3258,7 +3257,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
3258
3257
|
type: 'column',
|
3259
3258
|
events: {
|
3260
3259
|
'drilldown': function (e) {
|
3261
|
-
highchartsRenderer.modifyEventPointForDrilldown(e
|
3260
|
+
highchartsRenderer.modifyEventPointForDrilldown(e);
|
3262
3261
|
if (drilldownFunc)
|
3263
3262
|
drilldownFunc(e, this, "drilldown");
|
3264
3263
|
|
@@ -5180,7 +5179,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
5180
5179
|
return 'Wrong date format';
|
5181
5180
|
}
|
5182
5181
|
} else {
|
5183
|
-
const isFormatting =
|
5182
|
+
const isFormatting = isFormattingNumbers && format && !isNaN(value);
|
5184
5183
|
if (value === null || value === '[null]') {
|
5185
5184
|
return '[null]';
|
5186
5185
|
} else if (isFormatting) {
|
@@ -6041,7 +6040,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
6041
6040
|
opt = {};
|
6042
6041
|
}
|
6043
6042
|
opt.drillDownListFunc = (e) => {
|
6044
|
-
highchartsRenderer.modifyEventPointForDrilldown(e
|
6043
|
+
highchartsRenderer.modifyEventPointForDrilldown(e);
|
6045
6044
|
drillDownListFunc(e);
|
6046
6045
|
};
|
6047
6046
|
} else {
|
@@ -8167,7 +8166,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
8167
8166
|
}
|
8168
8167
|
all_vals.push(val);
|
8169
8168
|
});
|
8170
|
-
} else if (isFormattingNumbers
|
8169
|
+
} else if (isFormattingNumbers) {
|
8171
8170
|
all_vals = lodash.map(lodash.cloneDeep(fieldFilter.includes), val =>
|
8172
8171
|
highchartsRenderer.returnRawDataValue(fieldFilter.type, val, fieldFilter.format || '', null, null, true) + ""
|
8173
8172
|
);
|
@@ -8358,8 +8357,10 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
8358
8357
|
(element.datetypevalues && element.datetypevalues.datetype != 'list')
|
8359
8358
|
});
|
8360
8359
|
dashboardsFilters = lodash.map(dashboardsFilters, function (element) {
|
8361
|
-
var ret = {
|
8362
|
-
|
8360
|
+
var ret = {
|
8361
|
+
id: element.id,
|
8362
|
+
fields: element.fields,
|
8363
|
+
};
|
8363
8364
|
if (element.datetypevalues && element.datetypevalues.datetype != 'list')
|
8364
8365
|
ret['values'] = element.datetypevalues;
|
8365
8366
|
else {
|
@@ -8708,10 +8709,8 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
8708
8709
|
let temp = highchartsRenderer.createFilterObject(widget.rows[index]);
|
8709
8710
|
|
8710
8711
|
if (widget.rows[index].type === 'Date' && row_value !== NULL_VALUE) {
|
8711
|
-
|
8712
|
-
|
8713
|
-
highchartsRenderer.getDateFieldFormat(widget, widget.rows[index])
|
8714
|
-
);
|
8712
|
+
const format = highchartsRenderer.getDateFieldFormat(widget, widget.rows[index]);
|
8713
|
+
let datetrange = highchartsRenderer.createDateTypeFromValue(row_value, format);
|
8715
8714
|
|
8716
8715
|
if ($.isEmptyObject(datetrange)) {
|
8717
8716
|
return;
|
@@ -9609,15 +9608,11 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
9609
9608
|
}
|
9610
9609
|
|
9611
9610
|
highchartsRenderer.isFormattingNumberAxis = function (pivotData) {
|
9612
|
-
return
|
9611
|
+
return pivotData.isFormattingAxisLabels;
|
9613
9612
|
}
|
9614
9613
|
|
9615
9614
|
highchartsRenderer.isFormattingDatesAsOtherAxisTypes = function () {
|
9616
|
-
return highchartsRenderer.
|
9617
|
-
}
|
9618
|
-
|
9619
|
-
highchartsRenderer.isFormattingAxisFeatureOn = function () {
|
9620
|
-
return highchartsRenderer.hasFeature(FEATURES.FORMAT_AXIS);
|
9615
|
+
return highchartsRenderer.hasFeature(FEATURES.FORMAT_DATES_AS_OTHER_AXIS_TYPES);
|
9621
9616
|
}
|
9622
9617
|
|
9623
9618
|
highchartsRenderer.sortHasBeenDoneOnBE = function (keysObject) {
|
@@ -9664,9 +9659,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
9664
9659
|
|
9665
9660
|
highchartsRenderer.getFormattedKeys = function(pivotData, isCols, keys) {
|
9666
9661
|
keys = keys || (isCols ? pivotData.getColKeys() : pivotData.getRowKeys());
|
9667
|
-
return highchartsRenderer.
|
9668
|
-
? lodash.map(keys, key => highchartsRenderer.getFormattedKey(key, pivotData, isCols ? 'colFormats' : 'rowFormats'))
|
9669
|
-
: keys;
|
9662
|
+
return lodash.map(keys, key => highchartsRenderer.getFormattedKey(key, pivotData, isCols ? 'colFormats' : 'rowFormats'));
|
9670
9663
|
}
|
9671
9664
|
|
9672
9665
|
highchartsRenderer.getFormattedColKeys = function(pivotData, keys) {
|
@@ -9677,23 +9670,21 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
9677
9670
|
return highchartsRenderer.getFormattedKeys(pivotData, false, keys);
|
9678
9671
|
}
|
9679
9672
|
|
9680
|
-
highchartsRenderer.modifyEventPointForDrilldown = function(e
|
9681
|
-
if (!highchartsRenderer.isFormattingAxisFeatureOn()) {
|
9682
|
-
return;
|
9683
|
-
}
|
9673
|
+
highchartsRenderer.modifyEventPointForDrilldown = function(e) {
|
9684
9674
|
e.point = lodash.cloneDeep(e.point);
|
9685
9675
|
e.point.name = e.point.initialName;
|
9686
9676
|
e.point.series.name = lodash.get(e.point.series, 'userOptions.initialName', e.point.series.name);
|
9687
9677
|
lodash.set(e, 'point.category.userOptions', e.point.initialName.toString().split(highchartsRenderer.delimer));
|
9688
9678
|
}
|
9689
9679
|
|
9690
|
-
highchartsRenderer.getSeriesNameInFormatterContext = function(context
|
9691
|
-
return (
|
9680
|
+
highchartsRenderer.getSeriesNameInFormatterContext = function(context) {
|
9681
|
+
return (lodash.get(context, 'series.userOptions.initialName') || context.series.name || '') + "";
|
9692
9682
|
}
|
9693
9683
|
|
9694
|
-
highchartsRenderer.getColsInFormatterContext = function(context
|
9684
|
+
highchartsRenderer.getColsInFormatterContext = function(context) {
|
9695
9685
|
return lodash.get(context, 'point.options.colsForTotal')
|
9696
|
-
||
|
9686
|
+
|| lodash.get(context, 'point.initialName')
|
9687
|
+
|| lodash.get(context, 'options.initialName')
|
9697
9688
|
|| context.key;
|
9698
9689
|
}
|
9699
9690
|
|
@@ -4856,274 +4856,158 @@ describe('highcharts_renderer', () => {
|
|
4856
4856
|
});
|
4857
4857
|
|
4858
4858
|
describe('Function isFormattingNumberAxis', () => {
|
4859
|
-
it('should return true if
|
4859
|
+
it('should return true if isFormattingAxisLabels is true', () => {
|
4860
4860
|
const pivotData = { isFormattingAxisLabels: true };
|
4861
|
-
lodash.set(document, 'ReportHippo.user.features', ['use_default_table_format_for_axis']);
|
4862
4861
|
expect(highchartsRenderer.isFormattingNumberAxis(pivotData)).toEqual(true);
|
4863
4862
|
});
|
4864
4863
|
|
4865
|
-
it('should return false if FF is false', () => {
|
4866
|
-
const pivotData = { isFormattingAxisLabels: true };
|
4867
|
-
lodash.set(document, 'ReportHippo.user.features', []);
|
4868
|
-
expect(highchartsRenderer.isFormattingNumberAxis(pivotData)).toEqual(false);
|
4869
|
-
});
|
4870
4864
|
|
4871
|
-
it('should return false if
|
4865
|
+
it('should return false if isFormattingAxisLabels is false', () => {
|
4872
4866
|
const pivotData = { isFormattingAxisLabels: false };
|
4873
|
-
lodash.set(document, 'ReportHippo.user.features', []);
|
4874
4867
|
expect(highchartsRenderer.isFormattingNumberAxis(pivotData)).toEqual(false);
|
4875
4868
|
});
|
4876
4869
|
});
|
4877
4870
|
|
4878
4871
|
describe('Function getFormattedKey', () => {
|
4879
|
-
|
4880
|
-
|
4881
|
-
|
4882
|
-
|
4883
|
-
|
4884
|
-
|
4885
|
-
|
4886
|
-
|
4887
|
-
|
4888
|
-
|
4889
|
-
|
4890
|
-
};
|
4891
|
-
const type = 'colFormats';
|
4892
|
-
const formattedKey = highchartsRenderer.getFormattedKey(initialKey, pivotData, type);
|
4893
|
-
expect(formattedKey).toEqual(['$1000.0']);
|
4894
|
-
});
|
4895
|
-
|
4896
|
-
it('should return properly formatted rowKey as array', () => {
|
4897
|
-
const initialKey = ['1000'];
|
4898
|
-
const pivotData = {
|
4899
|
-
colFormats: [{ type: 'Float', format: '€####.##' }, { type: 'Float', format: '£####.##' }],
|
4900
|
-
rowFormats: [{ type: 'Float', format: '$####.##' }, { type: 'Float', format: '₪####.##' }],
|
4901
|
-
isFormattingAxisLabels: true,
|
4902
|
-
};
|
4903
|
-
const type = 'rowFormats';
|
4904
|
-
const formattedKey = highchartsRenderer.getFormattedKey(initialKey, pivotData, type);
|
4905
|
-
expect(formattedKey).toEqual(['$1000.0']);
|
4906
|
-
});
|
4907
|
-
|
4908
|
-
it('should return properly formatted colKey as string', () => {
|
4909
|
-
const initialKey = '1000';
|
4910
|
-
const pivotData = {
|
4911
|
-
colFormats: [{ type: 'Float', format: '$####.##' }, { type: 'Float', format: '₪####.##' }],
|
4912
|
-
rowFormats: [{ type: 'Float', format: '€####.##' }, { type: 'Float', format: '£####.##' }],
|
4913
|
-
isFormattingAxisLabels: true,
|
4914
|
-
};
|
4915
|
-
const type = 'colFormats';
|
4916
|
-
const formattedKey = highchartsRenderer.getFormattedKey(initialKey, pivotData, type);
|
4917
|
-
expect(formattedKey).toEqual('$1000.0');
|
4918
|
-
});
|
4919
|
-
|
4920
|
-
it('should return properly formatted rowKey as string', () => {
|
4921
|
-
const initialKey = '1000';
|
4922
|
-
const pivotData = {
|
4923
|
-
colFormats: [{ type: 'Float', format: '€####.##' }, { type: 'Float', format: '£####.##' }],
|
4924
|
-
rowFormats: [{ type: 'Float', format: '$####.##' }, { type: 'Float', format: '₪####.##' }],
|
4925
|
-
isFormattingAxisLabels: true,
|
4926
|
-
};
|
4927
|
-
const type = 'rowFormats';
|
4928
|
-
const formattedKey = highchartsRenderer.getFormattedKey(initialKey, pivotData, type);
|
4929
|
-
expect(formattedKey).toEqual('$1000.0');
|
4930
|
-
});
|
4931
|
-
|
4932
|
-
it('should return formatted multivalue colKey as string', () => {
|
4933
|
-
const initialKey = '1000 , 2000';
|
4934
|
-
const pivotData = {
|
4935
|
-
colFormats: [{ type: 'Float', format: '$####.##' }, { type: 'Float', format: '₪####.##' }],
|
4936
|
-
isFormattingAxisLabels: true,
|
4937
|
-
};
|
4938
|
-
const type = 'colFormats';
|
4939
|
-
const formattedKey = highchartsRenderer.getFormattedKey(initialKey, pivotData, type);
|
4940
|
-
expect(formattedKey).toEqual('$1000.0 , ₪2000.0');
|
4941
|
-
});
|
4942
|
-
|
4943
|
-
it('should return formatted multivalue colKey as array', () => {
|
4944
|
-
const initialKey = ['1000', '2000'];
|
4945
|
-
const pivotData = {
|
4946
|
-
colFormats: [{ type: 'Float', format: '$####.##' }, { type: 'Float', format: '₪####.##' }],
|
4947
|
-
isFormattingAxisLabels: true,
|
4948
|
-
};
|
4949
|
-
const type = 'colFormats';
|
4950
|
-
const formattedKey = highchartsRenderer.getFormattedKey(initialKey, pivotData, type);
|
4951
|
-
expect(formattedKey).toEqual(['$1000.0', '₪2000.0']);
|
4952
|
-
});
|
4953
|
-
|
4954
|
-
it('should return not formatted second value (test as array)', () => {
|
4955
|
-
const initialKey = ['1000', '2000'];
|
4956
|
-
const pivotData = {
|
4957
|
-
colFormats: [{ type: 'Float', format: '$####.##' }, null],
|
4958
|
-
isFormattingAxisLabels: true,
|
4959
|
-
};
|
4960
|
-
const type = 'colFormats';
|
4961
|
-
const formattedKey = highchartsRenderer.getFormattedKey(initialKey, pivotData, type);
|
4962
|
-
expect(formattedKey).toEqual(['$1000.0', '2000']);
|
4963
|
-
});
|
4872
|
+
it('should return properly formatted colKey as array', () => {
|
4873
|
+
const initialKey = ['1000'];
|
4874
|
+
const pivotData = {
|
4875
|
+
colFormats: [{ type: 'Float', format: '$####.##' }, { type: 'Float', format: '₪####.##' }],
|
4876
|
+
rowFormats: [{ type: 'Float', format: '€####.##' }, { type: 'Float', format: '£####.##' }],
|
4877
|
+
isFormattingAxisLabels: true,
|
4878
|
+
};
|
4879
|
+
const type = 'colFormats';
|
4880
|
+
const formattedKey = highchartsRenderer.getFormattedKey(initialKey, pivotData, type);
|
4881
|
+
expect(formattedKey).toEqual(['$1000.0']);
|
4882
|
+
});
|
4964
4883
|
|
4965
|
-
|
4966
|
-
|
4967
|
-
|
4968
|
-
|
4969
|
-
|
4970
|
-
|
4971
|
-
|
4972
|
-
|
4973
|
-
|
4974
|
-
|
4884
|
+
it('should return properly formatted rowKey as array', () => {
|
4885
|
+
const initialKey = ['1000'];
|
4886
|
+
const pivotData = {
|
4887
|
+
colFormats: [{ type: 'Float', format: '€####.##' }, { type: 'Float', format: '£####.##' }],
|
4888
|
+
rowFormats: [{ type: 'Float', format: '$####.##' }, { type: 'Float', format: '₪####.##' }],
|
4889
|
+
isFormattingAxisLabels: true,
|
4890
|
+
};
|
4891
|
+
const type = 'rowFormats';
|
4892
|
+
const formattedKey = highchartsRenderer.getFormattedKey(initialKey, pivotData, type);
|
4893
|
+
expect(formattedKey).toEqual(['$1000.0']);
|
4894
|
+
});
|
4975
4895
|
|
4976
|
-
|
4977
|
-
|
4978
|
-
|
4979
|
-
|
4980
|
-
|
4981
|
-
|
4982
|
-
|
4983
|
-
|
4984
|
-
|
4985
|
-
|
4986
|
-
|
4987
|
-
});
|
4896
|
+
it('should return properly formatted colKey as string', () => {
|
4897
|
+
const initialKey = '1000';
|
4898
|
+
const pivotData = {
|
4899
|
+
colFormats: [{ type: 'Float', format: '$####.##' }, { type: 'Float', format: '₪####.##' }],
|
4900
|
+
rowFormats: [{ type: 'Float', format: '€####.##' }, { type: 'Float', format: '£####.##' }],
|
4901
|
+
isFormattingAxisLabels: true,
|
4902
|
+
};
|
4903
|
+
const type = 'colFormats';
|
4904
|
+
const formattedKey = highchartsRenderer.getFormattedKey(initialKey, pivotData, type);
|
4905
|
+
expect(formattedKey).toEqual('$1000.0');
|
4906
|
+
});
|
4988
4907
|
|
4989
|
-
|
4990
|
-
|
4991
|
-
|
4992
|
-
|
4993
|
-
|
4994
|
-
|
4995
|
-
|
4996
|
-
|
4997
|
-
|
4998
|
-
|
4999
|
-
|
4908
|
+
it('should return properly formatted rowKey as string', () => {
|
4909
|
+
const initialKey = '1000';
|
4910
|
+
const pivotData = {
|
4911
|
+
colFormats: [{ type: 'Float', format: '€####.##' }, { type: 'Float', format: '£####.##' }],
|
4912
|
+
rowFormats: [{ type: 'Float', format: '$####.##' }, { type: 'Float', format: '₪####.##' }],
|
4913
|
+
isFormattingAxisLabels: true,
|
4914
|
+
};
|
4915
|
+
const type = 'rowFormats';
|
4916
|
+
const formattedKey = highchartsRenderer.getFormattedKey(initialKey, pivotData, type);
|
4917
|
+
expect(formattedKey).toEqual('$1000.0');
|
4918
|
+
});
|
5000
4919
|
|
5001
|
-
|
5002
|
-
|
5003
|
-
|
5004
|
-
|
5005
|
-
|
5006
|
-
|
5007
|
-
|
5008
|
-
|
5009
|
-
|
5010
|
-
|
5011
|
-
});
|
4920
|
+
it('should return formatted multivalue colKey as string', () => {
|
4921
|
+
const initialKey = '1000 , 2000';
|
4922
|
+
const pivotData = {
|
4923
|
+
colFormats: [{ type: 'Float', format: '$####.##' }, { type: 'Float', format: '₪####.##' }],
|
4924
|
+
isFormattingAxisLabels: true,
|
4925
|
+
};
|
4926
|
+
const type = 'colFormats';
|
4927
|
+
const formattedKey = highchartsRenderer.getFormattedKey(initialKey, pivotData, type);
|
4928
|
+
expect(formattedKey).toEqual('$1000.0 , ₪2000.0');
|
4929
|
+
});
|
5012
4930
|
|
5013
|
-
|
5014
|
-
|
5015
|
-
|
5016
|
-
|
5017
|
-
|
5018
|
-
|
5019
|
-
|
5020
|
-
|
5021
|
-
|
5022
|
-
expect(formattedKey).toEqual(initialKeyAlreadyFormatted);
|
5023
|
-
});
|
5024
|
-
});
|
4931
|
+
it('should return formatted multivalue colKey as array', () => {
|
4932
|
+
const initialKey = ['1000', '2000'];
|
4933
|
+
const pivotData = {
|
4934
|
+
colFormats: [{ type: 'Float', format: '$####.##' }, { type: 'Float', format: '₪####.##' }],
|
4935
|
+
isFormattingAxisLabels: true,
|
4936
|
+
};
|
4937
|
+
const type = 'colFormats';
|
4938
|
+
const formattedKey = highchartsRenderer.getFormattedKey(initialKey, pivotData, type);
|
4939
|
+
expect(formattedKey).toEqual(['$1000.0', '₪2000.0']);
|
5025
4940
|
});
|
5026
4941
|
|
5027
|
-
|
5028
|
-
|
5029
|
-
|
5030
|
-
|
5031
|
-
|
5032
|
-
|
5033
|
-
|
5034
|
-
|
5035
|
-
|
5036
|
-
|
5037
|
-
isFormattingAxisLabels: true,
|
5038
|
-
};
|
5039
|
-
const type = 'colFormats';
|
5040
|
-
const formattedKey = highchartsRenderer.getFormattedKey(initialKey, pivotData, type,);
|
5041
|
-
expect(formattedKey).toEqual(['1000']);
|
5042
|
-
});
|
4942
|
+
it('should return not formatted second value (test as array)', () => {
|
4943
|
+
const initialKey = ['1000', '2000'];
|
4944
|
+
const pivotData = {
|
4945
|
+
colFormats: [{ type: 'Float', format: '$####.##' }, null],
|
4946
|
+
isFormattingAxisLabels: true,
|
4947
|
+
};
|
4948
|
+
const type = 'colFormats';
|
4949
|
+
const formattedKey = highchartsRenderer.getFormattedKey(initialKey, pivotData, type);
|
4950
|
+
expect(formattedKey).toEqual(['$1000.0', '2000']);
|
4951
|
+
});
|
5043
4952
|
|
5044
|
-
|
5045
|
-
|
5046
|
-
|
5047
|
-
|
5048
|
-
|
5049
|
-
|
5050
|
-
|
5051
|
-
|
5052
|
-
|
5053
|
-
|
5054
|
-
});
|
4953
|
+
it('should return not formatted first value (test as array)', () => {
|
4954
|
+
const initialKey = ['1000', '2000'];
|
4955
|
+
const pivotData = {
|
4956
|
+
colFormats: [null, { type: 'Float', format: '$####.##' }],
|
4957
|
+
isFormattingAxisLabels: true,
|
4958
|
+
};
|
4959
|
+
const type = 'colFormats';
|
4960
|
+
const formattedKey = highchartsRenderer.getFormattedKey(initialKey, pivotData, type);
|
4961
|
+
expect(formattedKey).toEqual(['1000', '$2000.0']);
|
4962
|
+
});
|
5055
4963
|
|
5056
|
-
|
5057
|
-
|
4964
|
+
describe('formatting Dates', () => {
|
4965
|
+
it('should return formatted multivalue colKey as array (format_dates_as_other_axis_types is ON)', () => {
|
4966
|
+
lodash.set(document, 'ReportHippo.user.features', ['format_dates_as_other_axis_types']);
|
4967
|
+
const initialKey = [1687277052, 1687277052];
|
5058
4968
|
const pivotData = {
|
5059
|
-
colFormats: [{ type: '
|
5060
|
-
rowFormats: [{ type: 'Float', format: '€####.##' }, { type: 'Float', format: '£####.##' }],
|
4969
|
+
colFormats: [{ type: 'Date', format: 'MM/DD/YYYY' }, { type: 'Date', format: 'MMM-yy' }],
|
5061
4970
|
isFormattingAxisLabels: true,
|
5062
4971
|
};
|
5063
4972
|
const type = 'colFormats';
|
5064
4973
|
const formattedKey = highchartsRenderer.getFormattedKey(initialKey, pivotData, type);
|
5065
|
-
expect(formattedKey).toEqual('
|
4974
|
+
expect(formattedKey).toEqual(['06/20/2023', 'Jun-23']);
|
5066
4975
|
});
|
5067
4976
|
|
5068
|
-
it('should return
|
5069
|
-
|
4977
|
+
it('should return formatted multivalue rowKey as array (format_dates_as_other_axis_types is ON)', () => {
|
4978
|
+
lodash.set(document, 'ReportHippo.user.features', ['format_dates_as_other_axis_types']);
|
4979
|
+
const initialKey = [1687277052, 1687277052];
|
5070
4980
|
const pivotData = {
|
5071
|
-
|
5072
|
-
rowFormats: [{ type: 'Float', format: '$####.##' }, { type: 'Float', format: '₪####.##' }],
|
4981
|
+
rowFormats: [{ type: 'Date', format: 'MM/DD/YYYY' }, { type: 'Date', format: 'MMM-yy' }],
|
5073
4982
|
isFormattingAxisLabels: true,
|
5074
4983
|
};
|
5075
4984
|
const type = 'rowFormats';
|
5076
4985
|
const formattedKey = highchartsRenderer.getFormattedKey(initialKey, pivotData, type);
|
5077
|
-
expect(formattedKey).toEqual('
|
4986
|
+
expect(formattedKey).toEqual(['06/20/2023', 'Jun-23']);
|
5078
4987
|
});
|
5079
4988
|
|
5080
|
-
it('should return NOT formatted multivalue colKey as
|
5081
|
-
|
4989
|
+
it('should return NOT formatted multivalue colKey as array (format_dates_as_other_axis_types is OFF)', () => {
|
4990
|
+
lodash.set(document, 'ReportHippo.user.features', []);
|
4991
|
+
const initialKeyAlreadyFormatted = ['10/10/2020', '10/10/2021'];
|
5082
4992
|
const pivotData = {
|
5083
|
-
colFormats: [{ type: '
|
4993
|
+
colFormats: [{ type: 'Date', format: 'MM/DD/YYYY' }, { type: 'Date', format: 'MMM-yy' }],
|
5084
4994
|
isFormattingAxisLabels: true,
|
5085
4995
|
};
|
5086
4996
|
const type = 'colFormats';
|
5087
|
-
const formattedKey = highchartsRenderer.getFormattedKey(
|
5088
|
-
expect(formattedKey).toEqual(
|
4997
|
+
const formattedKey = highchartsRenderer.getFormattedKey(initialKeyAlreadyFormatted, pivotData, type);
|
4998
|
+
expect(formattedKey).toEqual(initialKeyAlreadyFormatted);
|
5089
4999
|
});
|
5090
5000
|
|
5091
|
-
it('should return NOT formatted multivalue
|
5092
|
-
|
5001
|
+
it('should return NOT formatted multivalue rowKey as array (format_dates_as_other_axis_types is OFF)', () => {
|
5002
|
+
lodash.set(document, 'ReportHippo.user.features', []);
|
5003
|
+
const initialKeyAlreadyFormatted = ['10/10/2020', '10/10/2021'];
|
5093
5004
|
const pivotData = {
|
5094
|
-
|
5005
|
+
rowFormats: [{ type: 'Date', format: 'MM/DD/YYYY' }, { type: 'Date', format: 'MMM-yy' }],
|
5095
5006
|
isFormattingAxisLabels: true,
|
5096
5007
|
};
|
5097
|
-
const type = '
|
5098
|
-
const formattedKey = highchartsRenderer.getFormattedKey(
|
5099
|
-
expect(formattedKey).toEqual(
|
5100
|
-
});
|
5101
|
-
|
5102
|
-
describe('formatting Dates', () => {
|
5103
|
-
|
5104
|
-
it('should return NOT formatted multivalue colKey as array (even when format_dates_as_other_axis_types is ON)', () => {
|
5105
|
-
lodash.set(document, 'ReportHippo.user.features', ['format_dates_as_other_axis_types']);
|
5106
|
-
const initialKeyAlreadyFormatted = ['10/10/2020', '10/10/2021'];
|
5107
|
-
const pivotData = {
|
5108
|
-
colFormats: [{ type: 'Date', format: 'MM/DD/YYYY' }, { type: 'Date', format: 'MMM-yy' }],
|
5109
|
-
isFormattingAxisLabels: true,
|
5110
|
-
};
|
5111
|
-
const type = 'colFormats';
|
5112
|
-
const formattedKey = highchartsRenderer.getFormattedKey(initialKeyAlreadyFormatted, pivotData, type);
|
5113
|
-
expect(formattedKey).toEqual(initialKeyAlreadyFormatted);
|
5114
|
-
});
|
5115
|
-
|
5116
|
-
it('should return NOT formatted multivalue rowKey as array (even when format_dates_as_other_axis_types is ON)', () => {
|
5117
|
-
lodash.set(document, 'ReportHippo.user.features', ['format_dates_as_other_axis_types']);
|
5118
|
-
const initialKeyAlreadyFormatted = ['10/10/2020', '10/10/2021'];
|
5119
|
-
const pivotData = {
|
5120
|
-
rowFormats: [{ type: 'Date', format: 'MM/DD/YYYY' }, { type: 'Date', format: 'MMM-yy' }],
|
5121
|
-
isFormattingAxisLabels: true,
|
5122
|
-
};
|
5123
|
-
const type = 'rowFormats';
|
5124
|
-
const formattedKey = highchartsRenderer.getFormattedKey(initialKeyAlreadyFormatted, pivotData, type);
|
5125
|
-
expect(formattedKey).toEqual(initialKeyAlreadyFormatted);
|
5126
|
-
});
|
5008
|
+
const type = 'rowFormats';
|
5009
|
+
const formattedKey = highchartsRenderer.getFormattedKey(initialKeyAlreadyFormatted, pivotData, type);
|
5010
|
+
expect(formattedKey).toEqual(initialKeyAlreadyFormatted);
|
5127
5011
|
});
|
5128
5012
|
});
|
5129
5013
|
});
|
@@ -5157,94 +5041,65 @@ describe('highcharts_renderer', () => {
|
|
5157
5041
|
spyOn(highchartsRenderer, 'getFormattedKey').and.callThrough();
|
5158
5042
|
});
|
5159
5043
|
|
5160
|
-
|
5161
|
-
|
5162
|
-
|
5163
|
-
|
5164
|
-
|
5165
|
-
|
5166
|
-
it('should call getFormattedKey 6 times', () => {
|
5167
|
-
pivotData.colFormats = [{ type: 'Float', format: '$####.##' }, { type: 'Float', format: '₪####.##' }];
|
5168
|
-
const isCols = true;
|
5169
|
-
highchartsRenderer.getFormattedKeys(pivotData, isCols, null);
|
5170
|
-
expect(highchartsRenderer.getFormattedKey).toHaveBeenCalledTimes(6);
|
5171
|
-
});
|
5172
|
-
|
5173
|
-
it('should return properly formatted colKeys as arrays [Dataset 1]', () => {
|
5174
|
-
pivotData.colFormats = [{ type: 'Float', format: '$####.##' }, { type: 'Float', format: '₪####.##' }];
|
5175
|
-
const isCols = true;
|
5176
|
-
const formattedKeys = highchartsRenderer.getFormattedKeys(pivotData, isCols, null);
|
5177
|
-
expect(formattedKeys).toEqual(
|
5178
|
-
[['$1.0', '₪11.0'], ['$2.0', '₪32.0'], ['[null]', '₪43.0'], ['$5.0', '₪54.0'], ['Others', '₪33.0'], ['$6.0', '₪98.0']]
|
5179
|
-
);
|
5180
|
-
});
|
5181
|
-
|
5182
|
-
it('should return properly formatted colKeys as arrays [Dataset 2]', () => {
|
5183
|
-
pivotData.colFormats = [null, { type: 'Float', format: '₪####.##'}];
|
5184
|
-
const isCols = true;
|
5185
|
-
const formattedKeys = highchartsRenderer.getFormattedKeys(pivotData, isCols, null);
|
5186
|
-
expect(formattedKeys).toEqual(
|
5187
|
-
[['1', '₪11.0'], ['2', '₪32.0'], ['[null]', '₪43.0'], ['5', '₪54.0'], ['Others', '₪33.0'], ['6', '₪98.0']]
|
5188
|
-
);
|
5189
|
-
});
|
5190
|
-
|
5191
|
-
it('should return properly formatted colKeys as arrays [Dataset 3]', () => {
|
5192
|
-
pivotData.colFormats = [{ type: 'Float', format: '$####.##' }, null];
|
5193
|
-
const isCols = true;
|
5194
|
-
const formattedKeys = highchartsRenderer.getFormattedKeys(pivotData, isCols, null);
|
5195
|
-
expect(formattedKeys).toEqual(
|
5196
|
-
[['$1.0', '11'], ['$2.0', '32'], ['[null]', '43'], ['$5.0', '54'], ['Others', '33'], ['$6.0', '98']]
|
5197
|
-
);
|
5198
|
-
});
|
5199
|
-
|
5200
|
-
it('should return properly formatted rowKeys as arrays [Dataset 1]', () => {
|
5201
|
-
pivotData.rowFormats = [{ type: 'Float', format: '$####.##' }, { type: 'Float', format: '₪####.##' }];
|
5202
|
-
const isCols = false;
|
5203
|
-
const formattedKeys = highchartsRenderer.getFormattedKeys(pivotData, isCols, null);
|
5204
|
-
expect(formattedKeys).toEqual(
|
5205
|
-
[['$1.0', '₪11.0'], ['$2.0', '₪32.0'], ['[null]', '₪43.0'], ['$5.0', '₪54.0'], ['Others', '₪33.0'], ['$6.0', '₪98.0']]
|
5206
|
-
);
|
5207
|
-
});
|
5208
|
-
|
5209
|
-
it('should return properly formatted rowKeys as arrays [Dataset 2]', () => {
|
5210
|
-
pivotData.rowFormats = [null, { type: 'Float', format: '₪####.##' }];
|
5211
|
-
const isCols = false;
|
5212
|
-
const formattedKeys = highchartsRenderer.getFormattedKeys(pivotData, isCols, null);
|
5213
|
-
expect(formattedKeys).toEqual(
|
5214
|
-
[['1', '₪11.0'], ['2', '₪32.0'], ['[null]', '₪43.0'], ['5', '₪54.0'], ['Others', '₪33.0'], ['6', '₪98.0']]
|
5215
|
-
);
|
5216
|
-
});
|
5044
|
+
it('should call getFormattedKey 6 times', () => {
|
5045
|
+
pivotData.colFormats = [{ type: 'Float', format: '$####.##' }, { type: 'Float', format: '₪####.##' }];
|
5046
|
+
const isCols = true;
|
5047
|
+
highchartsRenderer.getFormattedKeys(pivotData, isCols, null);
|
5048
|
+
expect(highchartsRenderer.getFormattedKey).toHaveBeenCalledTimes(6);
|
5049
|
+
});
|
5217
5050
|
|
5218
|
-
|
5219
|
-
|
5220
|
-
|
5221
|
-
|
5222
|
-
|
5223
|
-
|
5224
|
-
|
5225
|
-
});
|
5051
|
+
it('should return properly formatted colKeys as arrays [Dataset 1]', () => {
|
5052
|
+
pivotData.colFormats = [{ type: 'Float', format: '$####.##' }, { type: 'Float', format: '₪####.##' }];
|
5053
|
+
const isCols = true;
|
5054
|
+
const formattedKeys = highchartsRenderer.getFormattedKeys(pivotData, isCols, null);
|
5055
|
+
expect(formattedKeys).toEqual(
|
5056
|
+
[['$1.0', '₪11.0'], ['$2.0', '₪32.0'], ['[null]', '₪43.0'], ['$5.0', '₪54.0'], ['Others', '₪33.0'], ['$6.0', '₪98.0']]
|
5057
|
+
);
|
5226
5058
|
});
|
5227
5059
|
|
5228
|
-
|
5060
|
+
it('should return properly formatted colKeys as arrays [Dataset 2]', () => {
|
5061
|
+
pivotData.colFormats = [null, { type: 'Float', format: '₪####.##'}];
|
5062
|
+
const isCols = true;
|
5063
|
+
const formattedKeys = highchartsRenderer.getFormattedKeys(pivotData, isCols, null);
|
5064
|
+
expect(formattedKeys).toEqual(
|
5065
|
+
[['1', '₪11.0'], ['2', '₪32.0'], ['[null]', '₪43.0'], ['5', '₪54.0'], ['Others', '₪33.0'], ['6', '₪98.0']]
|
5066
|
+
);
|
5067
|
+
});
|
5229
5068
|
|
5230
|
-
|
5069
|
+
it('should return properly formatted colKeys as arrays [Dataset 3]', () => {
|
5070
|
+
pivotData.colFormats = [{ type: 'Float', format: '$####.##' }, null];
|
5231
5071
|
const isCols = true;
|
5072
|
+
const formattedKeys = highchartsRenderer.getFormattedKeys(pivotData, isCols, null);
|
5073
|
+
expect(formattedKeys).toEqual(
|
5074
|
+
[['$1.0', '11'], ['$2.0', '32'], ['[null]', '43'], ['$5.0', '54'], ['Others', '33'], ['$6.0', '98']]
|
5075
|
+
);
|
5076
|
+
});
|
5232
5077
|
|
5233
|
-
|
5234
|
-
|
5235
|
-
|
5078
|
+
it('should return properly formatted rowKeys as arrays [Dataset 1]', () => {
|
5079
|
+
pivotData.rowFormats = [{ type: 'Float', format: '$####.##' }, { type: 'Float', format: '₪####.##' }];
|
5080
|
+
const isCols = false;
|
5081
|
+
const formattedKeys = highchartsRenderer.getFormattedKeys(pivotData, isCols, null);
|
5082
|
+
expect(formattedKeys).toEqual(
|
5083
|
+
[['$1.0', '₪11.0'], ['$2.0', '₪32.0'], ['[null]', '₪43.0'], ['$5.0', '₪54.0'], ['Others', '₪33.0'], ['$6.0', '₪98.0']]
|
5084
|
+
);
|
5085
|
+
});
|
5236
5086
|
|
5237
|
-
|
5238
|
-
|
5239
|
-
|
5240
|
-
|
5087
|
+
it('should return properly formatted rowKeys as arrays [Dataset 2]', () => {
|
5088
|
+
pivotData.rowFormats = [null, { type: 'Float', format: '₪####.##' }];
|
5089
|
+
const isCols = false;
|
5090
|
+
const formattedKeys = highchartsRenderer.getFormattedKeys(pivotData, isCols, null);
|
5091
|
+
expect(formattedKeys).toEqual(
|
5092
|
+
[['1', '₪11.0'], ['2', '₪32.0'], ['[null]', '₪43.0'], ['5', '₪54.0'], ['Others', '₪33.0'], ['6', '₪98.0']]
|
5093
|
+
);
|
5094
|
+
});
|
5241
5095
|
|
5242
|
-
|
5243
|
-
|
5244
|
-
|
5245
|
-
|
5246
|
-
|
5247
|
-
|
5096
|
+
it('should return properly formatted rowKeys as arrays [Dataset 3]', () => {
|
5097
|
+
pivotData.rowFormats = [{ type: 'Float', format: '$####.##' }, null];
|
5098
|
+
const isCols = false;
|
5099
|
+
const formattedKeys = highchartsRenderer.getFormattedKeys(pivotData, isCols, null);
|
5100
|
+
expect(formattedKeys).toEqual(
|
5101
|
+
[['$1.0', '11'], ['$2.0', '32'], ['[null]', '43'], ['$5.0', '54'], ['Others', '33'], ['$6.0', '98']]
|
5102
|
+
);
|
5248
5103
|
});
|
5249
5104
|
});
|
5250
5105
|
|
@@ -5290,19 +5145,8 @@ describe('highcharts_renderer', () => {
|
|
5290
5145
|
spyOn(highchartsRenderer, 'getFormattedKeys').and.returnValue(null);
|
5291
5146
|
});
|
5292
5147
|
|
5293
|
-
it('should
|
5294
|
-
const e = lodash.cloneDeep(event);
|
5295
|
-
lodash.set(document, 'ReportHippo.user.features', []);
|
5296
|
-
|
5297
|
-
highchartsRenderer.modifyEventPointForDrilldown(e, pivotData);
|
5298
|
-
expect(e.point.name).toEqual(event.point.name);
|
5299
|
-
expect(e.point.series.name).toEqual(event.point.series.name);
|
5300
|
-
expect(e.point.category.userOptions).toEqual(event.point.category.userOptions);
|
5301
|
-
});
|
5302
|
-
|
5303
|
-
it('should modify if FF is on', () => {
|
5148
|
+
it('should modify event point for drilldown with formatted value', () => {
|
5304
5149
|
const e = lodash.cloneDeep(event);
|
5305
|
-
lodash.set(document, 'ReportHippo.user.features', ['use_default_table_format_for_axis']);
|
5306
5150
|
|
5307
5151
|
highchartsRenderer.modifyEventPointForDrilldown(e, pivotData);
|
5308
5152
|
expect(e.point.name).toEqual(event.point.initialName);
|
@@ -5320,8 +5164,7 @@ describe('highcharts_renderer', () => {
|
|
5320
5164
|
isFormattingAxisLabels: true,
|
5321
5165
|
};
|
5322
5166
|
|
5323
|
-
it('should return series.userOptions.initialName if it is present
|
5324
|
-
lodash.set(document, 'ReportHippo.user.features', ['use_default_table_format_for_axis']);
|
5167
|
+
it('should return series.userOptions.initialName if it is present', () => {
|
5325
5168
|
const context = {
|
5326
5169
|
series: {
|
5327
5170
|
userOptions: {
|
@@ -5333,8 +5176,7 @@ describe('highcharts_renderer', () => {
|
|
5333
5176
|
expect(highchartsRenderer.getSeriesNameInFormatterContext(context, pivotData)).toEqual(name1);
|
5334
5177
|
});
|
5335
5178
|
|
5336
|
-
it('should return series.name if
|
5337
|
-
lodash.set(document, 'ReportHippo.user.features', ['use_default_table_format_for_axis']);
|
5179
|
+
it('should return series.name if series.userOptions.initialName is not present', () => {
|
5338
5180
|
const context = {
|
5339
5181
|
series: {
|
5340
5182
|
name: name2,
|
@@ -5342,19 +5184,6 @@ describe('highcharts_renderer', () => {
|
|
5342
5184
|
}
|
5343
5185
|
expect(highchartsRenderer.getSeriesNameInFormatterContext(context, pivotData)).toEqual(name2);
|
5344
5186
|
});
|
5345
|
-
|
5346
|
-
it('should return series.name if series.userOptions.initialName is present but axis formatting is off', () => {
|
5347
|
-
lodash.set(document, 'ReportHippo.user.features', []);
|
5348
|
-
const context = {
|
5349
|
-
series: {
|
5350
|
-
userOptions: {
|
5351
|
-
initialName: name1,
|
5352
|
-
},
|
5353
|
-
name: name2,
|
5354
|
-
}
|
5355
|
-
}
|
5356
|
-
expect(highchartsRenderer.getSeriesNameInFormatterContext(context, pivotData)).toEqual(name2);
|
5357
|
-
});
|
5358
5187
|
});
|
5359
5188
|
|
5360
5189
|
describe('Function getColsInFormatterContext', () => {
|
@@ -5377,14 +5206,10 @@ describe('highcharts_renderer', () => {
|
|
5377
5206
|
key: name2,
|
5378
5207
|
}
|
5379
5208
|
|
5380
|
-
|
5381
|
-
lodash.set(document, 'ReportHippo.user.features', features);
|
5382
|
-
expect(highchartsRenderer.getColsInFormatterContext(context, pivotData)).toEqual(name3);
|
5383
|
-
});
|
5209
|
+
expect(highchartsRenderer.getColsInFormatterContext(context, pivotData)).toEqual(name3);
|
5384
5210
|
});
|
5385
5211
|
|
5386
|
-
it('should return point.initialName if it is present and
|
5387
|
-
lodash.set(document, 'ReportHippo.user.features', ['use_default_table_format_for_axis']);
|
5212
|
+
it('should return point.initialName if it is present and colsForTotal is not present', () => {
|
5388
5213
|
const context = {
|
5389
5214
|
point: {
|
5390
5215
|
initialName: name1,
|
@@ -5397,22 +5222,7 @@ describe('highcharts_renderer', () => {
|
|
5397
5222
|
expect(highchartsRenderer.getColsInFormatterContext(context, pivotData)).toEqual(name1);
|
5398
5223
|
});
|
5399
5224
|
|
5400
|
-
it('should return
|
5401
|
-
lodash.set(document, 'ReportHippo.user.features', []);
|
5402
|
-
const context = {
|
5403
|
-
point: {
|
5404
|
-
initialName: name1,
|
5405
|
-
},
|
5406
|
-
options: {
|
5407
|
-
initialName: name3,
|
5408
|
-
},
|
5409
|
-
key: name2,
|
5410
|
-
};
|
5411
|
-
expect(highchartsRenderer.getColsInFormatterContext(context, pivotData)).toEqual(name2);
|
5412
|
-
});
|
5413
|
-
|
5414
|
-
it('should return options.initialName if FF is on, colsForTotal is not present and point.initialName is not present', () => {
|
5415
|
-
lodash.set(document, 'ReportHippo.user.features', ['use_default_table_format_for_axis']);
|
5225
|
+
it('should return options.initialName if colsForTotal is not present and point.initialName is not present', () => {
|
5416
5226
|
const context = {
|
5417
5227
|
options: {
|
5418
5228
|
initialName: name3,
|
@@ -5422,8 +5232,7 @@ describe('highcharts_renderer', () => {
|
|
5422
5232
|
expect(highchartsRenderer.getColsInFormatterContext(context, pivotData)).toEqual(name3);
|
5423
5233
|
});
|
5424
5234
|
|
5425
|
-
it('should return context.key
|
5426
|
-
lodash.set(document, 'ReportHippo.user.features', ['use_default_table_format_for_axis']);
|
5235
|
+
it('should return context.key no colsForTotal no point.initialName no options.initialName', () => {
|
5427
5236
|
const context = {
|
5428
5237
|
key: name2,
|
5429
5238
|
}
|