@datarailsshared/dr_renderer 1.5.89 → 1.5.94

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.
@@ -2052,13 +2052,10 @@ describe('highcharts_renderer', () => {
2052
2052
 
2053
2053
  it('should take old row data on second time', () => {
2054
2054
  const rowData = { rowData: '123' };
2055
- const sorters = { sorters: '123' };
2056
2055
  highchartsRenderer.addTemplateDataToWidgetOptions(template, widget, false);
2057
2056
  widget.pivot.rowData = rowData;
2058
- widget.pivot.sorters = sorters;
2059
2057
  highchartsRenderer.addTemplateDataToWidgetOptions(template, widget, false);
2060
2058
  expect(widget.pivot.rowData).toBe(rowData);
2061
- expect(widget.pivot.sorters).toBe(sorters);
2062
2059
  });
2063
2060
  });
2064
2061
 
@@ -3702,7 +3699,7 @@ describe('highcharts_renderer', () => {
3702
3699
  expect(highchartsRenderer.getCommonChartOptions(additionalOptions)).toEqual(expected);
3703
3700
  });
3704
3701
  });
3705
-
3702
+
3706
3703
  describe('function getDataLabelsStyle', () => {
3707
3704
  it('returns default style if additionalOptions is empty', () => {
3708
3705
  const additionalOptions = {};
@@ -3839,7 +3836,7 @@ describe('highcharts_renderer', () => {
3839
3836
  expect(result).toEqual(expected);
3840
3837
  });
3841
3838
  });
3842
-
3839
+
3843
3840
  describe('function getLabelOptionKey', () => {
3844
3841
  it('should return null if additionalOptions is not defined', () => {
3845
3842
  const result = highchartsRenderer.getLabelOptionKey(undefined);
@@ -3876,7 +3873,7 @@ describe('highcharts_renderer', () => {
3876
3873
  expect(result).toBe('label_option1');
3877
3874
  });
3878
3875
  });
3879
-
3876
+
3880
3877
  describe('function getDefaultValueForSubOptions', () => {
3881
3878
  const suboptions = {
3882
3879
  option1: {
@@ -3988,7 +3985,7 @@ describe('highcharts_renderer', () => {
3988
3985
  expect(result.value1).not.toBe(suboptions.option3.elements[0].default_value);
3989
3986
  });
3990
3987
  });
3991
-
3988
+
3992
3989
  describe('function getChartAxisLabel', () => {
3993
3990
  it('should return default value', () => {
3994
3991
  expect(highchartsRenderer.getChartAxisLabel('invalidType')).toBe('Axis (Category)')
@@ -4352,7 +4349,7 @@ describe('highcharts_renderer', () => {
4352
4349
  expect(() => highchartsRenderer.parseOptionsToObject(str)).toThrow();
4353
4350
  });
4354
4351
  });
4355
-
4352
+
4356
4353
  describe('function isDate', () => {
4357
4354
  it('returns true for valid date string', () => {
4358
4355
  expect(highchartsRenderer.isDate('2022-01-01')).toBe(true);
@@ -4745,7 +4742,7 @@ describe('highcharts_renderer', () => {
4745
4742
  describe('function transformRowsAndColsForBreakdown', () => {
4746
4743
  let point;
4747
4744
  let opts;
4748
-
4745
+
4749
4746
  beforeEach(() => {
4750
4747
  point = {
4751
4748
  options: {},
@@ -5163,6 +5160,17 @@ describe('highcharts_renderer', () => {
5163
5160
  const formattedKey = highchartsRenderer.getFormattedKey(initialKey, pivotData, type);
5164
5161
  expect(formattedKey).toEqual(initialKey);
5165
5162
  });
5163
+
5164
+ it('should return formatted value when type is Date and value is a valid moment date (with valid format)', () => {
5165
+ const initialKey = ['Q4-20'];
5166
+ const pivotData = {
5167
+ colFormats: [{ format: "[Q]Q-YY", name: "Date", type: "Date" }],
5168
+ isFormattingAxisLabels: true,
5169
+ };
5170
+ const type = 'colFormats';
5171
+ const formattedKey = highchartsRenderer.getFormattedKey(initialKey, pivotData, type);
5172
+ expect(formattedKey).toEqual(initialKey);
5173
+ });
5166
5174
  });
5167
5175
  });
5168
5176
 
@@ -5312,7 +5320,7 @@ describe('highcharts_renderer', () => {
5312
5320
  describe('Function getSeriesNameInFormatterContext', () => {
5313
5321
 
5314
5322
  const name1 = 'test series name';
5315
- const name2 = 'test series name 2';
5323
+ const name2 = 'test series name 2';
5316
5324
 
5317
5325
  const pivotData = {
5318
5326
  isFormattingAxisLabels: true,
@@ -5343,7 +5351,7 @@ describe('highcharts_renderer', () => {
5343
5351
  describe('Function getColsInFormatterContext', () => {
5344
5352
 
5345
5353
  const name1 = 'test series name 1';
5346
- const name2 = 'test series name 2';
5354
+ const name2 = 'test series name 2';
5347
5355
  const name3 = 'test series name 3';
5348
5356
  const pivotData = {
5349
5357
  isFormattingAxisLabels: true,
@@ -5395,170 +5403,6 @@ describe('highcharts_renderer', () => {
5395
5403
  });
5396
5404
 
5397
5405
 
5398
- describe('Function replaceSortingKeysWithMappedValues', () => {
5399
- it('should replace sorting keys with mapped values for Date fields', () => {
5400
- const keysObject = {
5401
- col_keys: [
5402
- [1640995200],
5403
- [1648684800],
5404
- [1667174400]
5405
- ],
5406
- row_keys: [],
5407
- row_keys_by_cols: [
5408
- [
5409
- ["Other Income"],
5410
- ["Other Expense"],
5411
- ["Income"],
5412
- ["Expenses"],
5413
- ["Cost of Goods Sold"]
5414
- ]
5415
- ]
5416
- };
5417
- const invertedDateStringMap = {
5418
- 1640995200: '2022-01-01',
5419
- 1648684800: '2022-03-29',
5420
- 1667174400: '2023-03-01'
5421
- };
5422
- const widget = {
5423
- cols: [{ type: 'Date' }],
5424
- rows: [{ type: 'NotDate' }],
5425
- pivot: {
5426
- keysObject: keysObject
5427
- }
5428
- };
5429
-
5430
- highchartsRenderer.replaceSortingKeysWithMappedValues(keysObject.col_keys, invertedDateStringMap, widget.cols);
5431
- highchartsRenderer.replaceSortingKeysWithMappedValues(keysObject.row_keys, invertedDateStringMap, widget.rows);
5432
- highchartsRenderer.replaceSortingKeysWithMappedValues(keysObject.row_keys_by_cols, invertedDateStringMap, widget.rows);
5433
-
5434
- expect(keysObject).toEqual({
5435
- col_keys: [
5436
- ['2022-01-01'],
5437
- ['2022-03-29'],
5438
- ['2023-03-01']
5439
- ],
5440
- row_keys: [],
5441
- row_keys_by_cols: [
5442
- [
5443
- ['Other Income'],
5444
- ['Other Expense'],
5445
- ['Income'],
5446
- ['Expenses'],
5447
- ['Cost of Goods Sold']
5448
- ]
5449
- ]
5450
- });
5451
- });
5452
-
5453
- it('should not replace sorting keys for non-Date fields', () => {
5454
- const keysObject = {
5455
- col_keys: [
5456
- [1640995200],
5457
- [1648684800],
5458
- [1667174400]
5459
- ],
5460
- row_keys: [],
5461
- row_keys_by_cols: [
5462
- [
5463
- ["Other Income"],
5464
- ["Other Expense"],
5465
- ["Income"],
5466
- ["Expenses"],
5467
- ["Cost of Goods Sold"]
5468
- ]
5469
- ]
5470
- };
5471
- const invertedDateStringMap = {
5472
- 1640995200: '2022-01-01',
5473
- 1648684800: '2022-03-29',
5474
- 1667174400: '2023-03-01'
5475
- };
5476
- const widget = {
5477
- cols: [{ type: 'NotDate' }],
5478
- rows: [{ type: 'NotDate' }],
5479
- pivot: {
5480
- keysObject: keysObject
5481
- }
5482
- };
5483
-
5484
- highchartsRenderer.replaceSortingKeysWithMappedValues(keysObject.col_keys, invertedDateStringMap, widget.cols);
5485
- highchartsRenderer.replaceSortingKeysWithMappedValues(keysObject.row_keys, invertedDateStringMap, widget.rows);
5486
- highchartsRenderer.replaceSortingKeysWithMappedValues(keysObject.row_keys_by_cols, invertedDateStringMap, widget.rows);
5487
-
5488
- expect(keysObject).toEqual({
5489
- col_keys: [
5490
- [1640995200],
5491
- [1648684800],
5492
- [1667174400]
5493
- ],
5494
- row_keys: [],
5495
- row_keys_by_cols: [
5496
- [
5497
- ["Other Income"],
5498
- ["Other Expense"],
5499
- ["Income"],
5500
- ["Expenses"],
5501
- ["Cost of Goods Sold"]
5502
- ]
5503
- ]
5504
- });
5505
- });
5506
-
5507
- it('should handle null or undefined keysObject', () => {
5508
- const invertedDateStringMap = {
5509
- 1640995200: '2022-01-01',
5510
- 1648684800: '2022-03-29',
5511
- 1667174400: '2023-03-01'
5512
- };
5513
- const widget = {
5514
- cols: [{ type: 'Date' }],
5515
- rows: [{ type: 'NotDate' }],
5516
- pivot: {
5517
- keysObject: null
5518
- }
5519
- };
5520
-
5521
- highchartsRenderer.replaceSortingKeysWithMappedValues(null, invertedDateStringMap, widget.cols);
5522
- highchartsRenderer.replaceSortingKeysWithMappedValues(null, invertedDateStringMap, widget.rows);
5523
- highchartsRenderer.replaceSortingKeysWithMappedValues(null, invertedDateStringMap, widget.rows);
5524
- });
5525
-
5526
- // This test was added to cover an edge case where multiple Date fields have the same date values
5527
- // but require different formatting based on their individual field settings
5528
- // Fixes the issue - https://datarailsteam.atlassian.net/browse/DR-37813
5529
- // Will be removed once "format_dates_as_other_axis_types" FF is deleted
5530
- it('should reformat dates when widget fields have same dates, but different formats', () => {
5531
- const keysObject = {
5532
- col_keys: [
5533
- [1648684800, 1648684800, 1648684800],
5534
- ],
5535
- row_keys: [],
5536
- row_keys_by_cols: [],
5537
- };
5538
-
5539
- const invertedDateStringMap = {
5540
- 1648684800: '03/31/2022',
5541
- };
5542
-
5543
- const widget = {
5544
- cols: [
5545
- { type: 'Date', format: null }, // Default format MM/DD/YYYY
5546
- { type: 'Date', format: 'MM-DD-YYYY' },
5547
- { type: 'Date', format: 'DD/MM/YYYY' },
5548
- ],
5549
- rows: [],
5550
- pivot: { keysObject },
5551
- };
5552
-
5553
- highchartsRenderer.replaceSortingKeysWithMappedValues(keysObject.col_keys, invertedDateStringMap, widget.cols);
5554
-
5555
- expect(keysObject.col_keys[0][0]).toBe('03/31/2022');
5556
- expect(keysObject.col_keys[0][1]).toBe('03-31-2022');
5557
- expect(keysObject.col_keys[0][2]).toBe('31/03/2022');
5558
- });
5559
- });
5560
-
5561
-
5562
5406
  describe('Functions getAggregatedSortingObjects', () => {
5563
5407
 
5564
5408
  const simpleRowData = [{ someField1: 'someValue1' }, { someField2: 'someValue2' }];
@@ -5586,7 +5430,7 @@ describe('highcharts_renderer', () => {
5586
5430
  it(testCase.description, () => {
5587
5431
  const rowData = lodash.concat(simpleRowData, testCase.expectedObj ? lodash.clone(testCase.expectedObj) : []);
5588
5432
  const sortObj = highchartsRenderer.getAggregatedSortingObjects(rowData);
5589
-
5433
+
5590
5434
  expect(rowData).toEqual(simpleRowData);
5591
5435
  expect(sortObj).toEqual(testCase.expectedObj);
5592
5436
  });
@@ -5662,7 +5506,7 @@ describe('highcharts_renderer', () => {
5662
5506
  getAggregator: (rows, cols) => {
5663
5507
  let aggregator = highchartsRenderer.rhPivotAggregatorSum([''], format, true, {}, {});
5664
5508
  const agg = aggregator({}, '', '');
5665
-
5509
+
5666
5510
  if (lodash.isEqual(cols, ['col 1']) && lodash.isEqual(rows, ['row 1'])) {
5667
5511
  agg.sum = 12345;
5668
5512
  } else if (lodash.isEqual(cols, ['col 1']) && lodash.isEqual(rows, [])) {
@@ -5687,7 +5531,7 @@ describe('highcharts_renderer', () => {
5687
5531
  getRowKeys: () => [['row 1'], ['row 2'], ['row 3']],
5688
5532
  rowAttrs: ['row 1'],
5689
5533
  };
5690
-
5534
+
5691
5535
  optsMock = {
5692
5536
  total_value_options: {
5693
5537
  filter_options: {
@@ -5702,7 +5546,7 @@ describe('highcharts_renderer', () => {
5702
5546
  },
5703
5547
  },
5704
5548
  };
5705
-
5549
+
5706
5550
  displayTooltipContext = {
5707
5551
  series: {
5708
5552
  options: {
@@ -5761,7 +5605,7 @@ describe('highcharts_renderer', () => {
5761
5605
  const tooltipFunction =
5762
5606
  highchartsRenderer.defaultFormatterToTooltip(pivotDataMock, optsMock, isForDrilldownPie);
5763
5607
  const tooltipHtml = tooltipFunction.call(displayTooltipContext);
5764
-
5608
+
5765
5609
  expect(tooltipHtml).toEqual(
5766
5610
  '<br/><span style="font-weight: bold; color: green;">\u200Erow 1</span>: <span>\u200E$12,345.00</span>'
5767
5611
  );
@@ -5773,7 +5617,7 @@ describe('highcharts_renderer', () => {
5773
5617
  const tooltipFunction =
5774
5618
  highchartsRenderer.defaultFormatterToTooltip(pivotDataMock, optsMock, isForDrilldownPie);
5775
5619
  const tooltipHtml = tooltipFunction.call(displayTooltipContext);
5776
-
5620
+
5777
5621
  expect(tooltipHtml).toEqual(
5778
5622
  `<span style="font-weight: bold;">
5779
5623
  col 1
@@ -5788,7 +5632,7 @@ describe('highcharts_renderer', () => {
5788
5632
  const tooltipFunction =
5789
5633
  highchartsRenderer.defaultFormatterToTooltip(pivotDataMock, optsMock, isForDrilldownPie);
5790
5634
  const tooltipHtml = tooltipFunction.call(displayTooltipContext);
5791
-
5635
+
5792
5636
  expect(tooltipHtml).toEqual(
5793
5637
  `<span style="font-weight: bold;">
5794
5638
  col 1
@@ -5804,7 +5648,7 @@ describe('highcharts_renderer', () => {
5804
5648
  const tooltipFunction =
5805
5649
  highchartsRenderer.defaultFormatterToTooltip(pivotDataMock, optsMock, isForDrilldownPie);
5806
5650
  const tooltipHtml = tooltipFunction.call(displayTooltipContext);
5807
-
5651
+
5808
5652
  expect(tooltipHtml).toEqual(
5809
5653
  `<span style="font-weight: bold;">
5810
5654
  col 1
@@ -5824,7 +5668,7 @@ describe('highcharts_renderer', () => {
5824
5668
  const tooltipFunction =
5825
5669
  highchartsRenderer.defaultFormatterToTooltip(pivotDataMock, optsMock, isForDrilldownPie);
5826
5670
  const tooltipHtml = tooltipFunction.call(displayTooltipContext);
5827
-
5671
+
5828
5672
  expect(tooltipHtml).toEqual(
5829
5673
  `<span style="font-weight: bold;">
5830
5674
  col 1
@@ -5840,7 +5684,7 @@ describe('highcharts_renderer', () => {
5840
5684
  const tooltipFunction =
5841
5685
  highchartsRenderer.defaultFormatterToTooltip(pivotDataMock, optsMock, isForDrilldownPie);
5842
5686
  const tooltipHtml = tooltipFunction.call(displayTooltipContext);
5843
-
5687
+
5844
5688
  expect(tooltipHtml).toEqual(
5845
5689
  `<span style="font-weight: bold;">
5846
5690
  col 1,col 2
@@ -5855,7 +5699,7 @@ describe('highcharts_renderer', () => {
5855
5699
  const tooltipFunction =
5856
5700
  highchartsRenderer.defaultFormatterToTooltip(pivotDataMock, optsMock, isForDrilldownPie);
5857
5701
  const tooltipHtml = tooltipFunction.call(displayTooltipContext);
5858
-
5702
+
5859
5703
  expect(tooltipHtml).toEqual(
5860
5704
  `<span style="font-weight: bold;">
5861
5705
  col 1
@@ -5869,7 +5713,7 @@ describe('highcharts_renderer', () => {
5869
5713
  const tooltipFunction =
5870
5714
  highchartsRenderer.defaultFormatterToTooltip(pivotDataMock, optsMock, isForDrilldownPie);
5871
5715
  const tooltipHtml = tooltipFunction.call(displayTooltipContext);
5872
-
5716
+
5873
5717
  expect(tooltipHtml).toEqual(
5874
5718
  `<span style="font-weight: bold;">
5875
5719
  ${ othersName }
@@ -5899,7 +5743,7 @@ describe('highcharts_renderer', () => {
5899
5743
  const tooltipFunction =
5900
5744
  highchartsRenderer.defaultFormatterToTooltip(pivotDataMock, optsMock, isForDrilldownPie);
5901
5745
  const tooltipHtml = tooltipFunction.call(displayTooltipContext);
5902
-
5746
+
5903
5747
  expect(tooltipHtml).toEqual(
5904
5748
  `<span style="font-weight: bold;">
5905
5749
  row 1 :
@@ -5929,7 +5773,7 @@ describe('highcharts_renderer', () => {
5929
5773
  const tooltipFunction =
5930
5774
  highchartsRenderer.defaultFormatterToTooltip(pivotDataMock, optsMock, isForDrilldownPie);
5931
5775
  const tooltipHtml = tooltipFunction.call(displayTooltipContext);
5932
-
5776
+
5933
5777
  expect(tooltipHtml).toEqual(
5934
5778
  `<span style="font-weight: bold;">
5935
5779
  col 1 :
@@ -5961,7 +5805,7 @@ describe('highcharts_renderer', () => {
5961
5805
  const tooltipFunction =
5962
5806
  highchartsRenderer.defaultFormatterToTooltip(pivotDataMock, optsMock, isForDrilldownPie);
5963
5807
  const tooltipHtml = tooltipFunction.call(displayTooltipContext);
5964
-
5808
+
5965
5809
  expect(tooltipHtml).toEqual(
5966
5810
  `<span style="font-weight: bold;">
5967
5811
  Total 1
@@ -5986,7 +5830,7 @@ describe('highcharts_renderer', () => {
5986
5830
  const tooltipFunction =
5987
5831
  highchartsRenderer.defaultFormatterToTooltip(pivotDataMock, optsMock, isForDrilldownPie);
5988
5832
  const tooltipHtml = tooltipFunction.call(displayTooltipContext);
5989
-
5833
+
5990
5834
  expect(tooltipHtml).toEqual('<span>\u200E$123,450.00</span>');
5991
5835
  });
5992
5836
 
@@ -6006,7 +5850,7 @@ describe('highcharts_renderer', () => {
6006
5850
  const tooltipFunction =
6007
5851
  highchartsRenderer.defaultFormatterToTooltip(pivotDataMock, optsMock, isForDrilldownPie);
6008
5852
  const tooltipHtml = tooltipFunction.call(displayTooltipContext);
6009
-
5853
+
6010
5854
  expect(tooltipHtml).toEqual(`<span style="font-weight: bold;">
6011
5855
  col 1
6012
5856
  </span><br/><span style="font-weight: bold; color: green;">\u200ETrend Line</span>: <span>\u200E$55,555.00</span>`
@@ -6234,13 +6078,15 @@ describe('highcharts_renderer', () => {
6234
6078
  }
6235
6079
  ];
6236
6080
  const subOptions = {
6237
- "sorters": () => null,
6238
- "sortByValueAttrs": [],
6239
6081
  "cols": [
6240
6082
  "Date",
6241
6083
  "Payment Date"
6242
6084
  ],
6243
6085
  "rows": [],
6086
+ "keysObject": {
6087
+ "row_keys": [[]],
6088
+ "col_keys": [[1651363200], [1652400000], [1653177600], [1653955200]],
6089
+ },
6244
6090
  "colFormats": [
6245
6091
  {
6246
6092
  "type": "Date",
@@ -6331,10 +6177,12 @@ describe('highcharts_renderer', () => {
6331
6177
  }
6332
6178
  ];
6333
6179
  const subOptions = {
6334
- "sorters": () => null,
6335
- "sortByValueAttrs": [],
6336
6180
  "cols": ["Date"],
6337
6181
  "rows": ["Type"],
6182
+ "keysObject": {
6183
+ "row_keys": [["Food"], ["Technology"]],
6184
+ "col_keys": [[1653177600], [1653955200]],
6185
+ },
6338
6186
  "colFormats": [
6339
6187
  {
6340
6188
  "type": "Date",
@@ -6352,7 +6200,7 @@ describe('highcharts_renderer', () => {
6352
6200
  "rendererOptions": {
6353
6201
  },
6354
6202
  };
6355
-
6203
+
6356
6204
  it('should create csv json object representation based on pivot data, with totals', () => {
6357
6205
  const chartOptions = {
6358
6206
  table_options: {
@@ -6372,7 +6220,7 @@ describe('highcharts_renderer', () => {
6372
6220
  ]
6373
6221
  );
6374
6222
  });
6375
-
6223
+
6376
6224
  it('should create csv json object representation based on pivot data, without col totals', () => {
6377
6225
  const chartOptions = {
6378
6226
  table_options: {
@@ -6389,7 +6237,7 @@ describe('highcharts_renderer', () => {
6389
6237
  ["Technology", 1, 1, 1]
6390
6238
  ]);
6391
6239
  });
6392
-
6240
+
6393
6241
  it('should create csv json object representation based on pivot data, without row totals', () => {
6394
6242
  const chartOptions = {
6395
6243
  table_options: {
@@ -6397,7 +6245,7 @@ describe('highcharts_renderer', () => {
6397
6245
  show_row_total: false,
6398
6246
  },
6399
6247
  };
6400
-
6248
+
6401
6249
  const pivotData = $.pivotUtilities.getPivotDataModel(inputs, subOptions);
6402
6250
  const csvJson = highchartsRenderer.tableCSVExportRenderer(pivotData, chartOptions);
6403
6251
  expect(csvJson).toEqual([
@@ -6408,7 +6256,7 @@ describe('highcharts_renderer', () => {
6408
6256
  ["Totals", 1, 1]
6409
6257
  ]);
6410
6258
  });
6411
-
6259
+
6412
6260
  it('should create csv json object representation based on pivot data, without col and row totals', () => {
6413
6261
  const chartOptions = {
6414
6262
  table_options: {
@@ -6416,7 +6264,7 @@ describe('highcharts_renderer', () => {
6416
6264
  show_row_total: false,
6417
6265
  },
6418
6266
  };
6419
-
6267
+
6420
6268
  const pivotData = $.pivotUtilities.getPivotDataModel(inputs, subOptions);
6421
6269
  const csvJson = highchartsRenderer.tableCSVExportRenderer(pivotData, chartOptions);
6422
6270
  expect(csvJson).toEqual([
@@ -7338,7 +7186,7 @@ describe('highcharts_renderer', () => {
7338
7186
  initialName: 'row 2',
7339
7187
  name: 'Total'
7340
7188
  }];
7341
-
7189
+
7342
7190
  it("should mark the series as total", () => {
7343
7191
  additionalOptionsMock = {};
7344
7192
  opts = {
@@ -8041,7 +7889,7 @@ describe('highcharts_renderer', () => {
8041
7889
  // Create dataset that exceeds MAX_ROWS_FOR_SHOW_RESULTS to trigger TooMuchDataError
8042
7890
  const largeRowData = new Array(highchartsRenderer.MAX_ROWS_FOR_SHOW_RESULTS + 1)
8043
7891
  .fill({ field1: 'value1', field2: 'value2' });
8044
-
7892
+
8045
7893
  const options = {
8046
7894
  onlyOptions: false,
8047
7895
  rendererOptions: {},
@@ -8057,7 +7905,7 @@ describe('highcharts_renderer', () => {
8057
7905
  // Create dataset that exceeds MAX_ROWS_FOR_SHOW_RESULTS
8058
7906
  const largeRowData = new Array(highchartsRenderer.MAX_ROWS_FOR_SHOW_RESULTS + 1)
8059
7907
  .fill({ field1: 'value1', field2: 'value2' });
8060
-
7908
+
8061
7909
  const options = {
8062
7910
  onlyOptions: true,
8063
7911
  rendererOptions: {},
@@ -8095,7 +7943,7 @@ describe('highcharts_renderer', () => {
8095
7943
  it('should handle renderer errors correctly', () => {
8096
7944
  const rowData = [{ field1: 'value1', field2: 'value2' }];
8097
7945
  const genericError = new Error('Renderer failed');
8098
-
7946
+
8099
7947
  const options = {
8100
7948
  onlyOptions: false,
8101
7949
  rendererOptions: {},
@@ -8113,7 +7961,7 @@ describe('highcharts_renderer', () => {
8113
7961
  it('should return empty object for renderer errors when onlyOptions is true', () => {
8114
7962
  const rowData = [{ field1: 'value1', field2: 'value2' }];
8115
7963
  const genericError = new Error('Renderer failed');
8116
-
7964
+
8117
7965
  const options = {
8118
7966
  onlyOptions: true,
8119
7967
  rendererOptions: {},
@@ -8129,7 +7977,7 @@ describe('highcharts_renderer', () => {
8129
7977
  it('should re-throw BaseRendererError instances from renderer unchanged', () => {
8130
7978
  const rowData = [{ field1: 'value1', field2: 'value2' }];
8131
7979
  const originalError = new NoDataError();
8132
-
7980
+
8133
7981
  const options = {
8134
7982
  onlyOptions: false,
8135
7983
  rendererOptions: {},
@@ -8142,7 +7990,7 @@ describe('highcharts_renderer', () => {
8142
7990
  expect(() => {
8143
7991
  highchartsRenderer.rhPivotView(rowData, options);
8144
7992
  }).toThrow(NoDataError);
8145
-
7993
+
8146
7994
  expect(() => {
8147
7995
  highchartsRenderer.rhPivotView(rowData, options);
8148
7996
  }).toThrow(originalError);
@@ -8150,7 +7998,7 @@ describe('highcharts_renderer', () => {
8150
7998
 
8151
7999
  it('should handle null/undefined from renderer as GenericRenderingError', () => {
8152
8000
  const rowData = [{ field1: 'value1', field2: 'value2' }];
8153
-
8001
+
8154
8002
  // Test null
8155
8003
  const nullOptions = {
8156
8004
  onlyOptions: false,
@@ -8304,7 +8152,7 @@ describe('highcharts_renderer', () => {
8304
8152
  .and.callFake((initialName, pivotData) => `formatted(${ initialName })`);
8305
8153
  spyOn(highchartsRenderer, 'isFormattingDatesAsOtherAxisTypes').and.returnValue(true);
8306
8154
  });
8307
-
8155
+
8308
8156
  it("should create appropriate series for case when only one column field and one total", () => {
8309
8157
  const pivotDataMock = lodash.cloneDeep(pivotDataMockForOneFieldAndOneTotal);
8310
8158
 
@@ -8357,7 +8205,7 @@ describe('highcharts_renderer', () => {
8357
8205
  colsForTotal: null,
8358
8206
  initialName: "3",
8359
8207
  isSum: false,
8360
- isTotal: false,
8208
+ isTotal: false,
8361
8209
  name: "formatted(3)",
8362
8210
  totalIndex: undefined,
8363
8211
  y: -40
@@ -8437,7 +8285,7 @@ describe('highcharts_renderer', () => {
8437
8285
  colsForTotal: null,
8438
8286
  initialName: "3",
8439
8287
  isSum: false,
8440
- isTotal: false,
8288
+ isTotal: false,
8441
8289
  name: "formatted(3)",
8442
8290
  totalIndex: undefined,
8443
8291
  y: -40
@@ -8526,7 +8374,7 @@ describe('highcharts_renderer', () => {
8526
8374
  colsForTotal: null,
8527
8375
  initialName: "2 , 1707389500",
8528
8376
  isSum: false,
8529
- isTotal: false,
8377
+ isTotal: false,
8530
8378
  name: "formatted(2 , 1707389500)",
8531
8379
  totalIndex: undefined,
8532
8380
  y: -40
@@ -8615,7 +8463,7 @@ describe('highcharts_renderer', () => {
8615
8463
  colsForTotal: null,
8616
8464
  initialName: "2 , 1707389500",
8617
8465
  isSum: false,
8618
- isTotal: false,
8466
+ isTotal: false,
8619
8467
  name: "formatted(2 , 1707389500)",
8620
8468
  totalIndex: undefined,
8621
8469
  y: -40
@@ -8706,7 +8554,7 @@ describe('highcharts_renderer', () => {
8706
8554
  colsForTotal: null,
8707
8555
  initialName: "2 , 1707389500",
8708
8556
  isSum: false,
8709
- isTotal: false,
8557
+ isTotal: false,
8710
8558
  name: "formatted(2 , 1707389500)",
8711
8559
  totalIndex: undefined,
8712
8560
  y: -40
@@ -8792,7 +8640,7 @@ describe('highcharts_renderer', () => {
8792
8640
  colsForTotal: null,
8793
8641
  initialName: "2 , 1707389500",
8794
8642
  isSum: false,
8795
- isTotal: false,
8643
+ isTotal: false,
8796
8644
  name: "formatted(2 , 1707389500)",
8797
8645
  totalIndex: undefined,
8798
8646
  y: -40
@@ -8878,7 +8726,7 @@ describe('highcharts_renderer', () => {
8878
8726
  colsForTotal: null,
8879
8727
  initialName: "2 , 1707389500",
8880
8728
  isSum: false,
8881
- isTotal: false,
8729
+ isTotal: false,
8882
8730
  name: "formatted(2 , 1707389500)",
8883
8731
  totalIndex: undefined,
8884
8732
  y: -40
@@ -8923,11 +8771,11 @@ describe('highcharts_renderer', () => {
8923
8771
  .mockReturnValue([{ name: 'Sample Series', data: [1, 2, 3] }]);
8924
8772
  jest.spyOn(highchartsRenderer, 'ptCreateElementAndDraw').mockImplementation(() => {});
8925
8773
  });
8926
-
8774
+
8927
8775
  afterEach(() => {
8928
8776
  jest.restoreAllMocks();
8929
8777
  });
8930
-
8778
+
8931
8779
  it('should call ptCreateElementAndDraw with correct chart options', () => {
8932
8780
  const pivotData = {
8933
8781
  getColKeys: jest.fn(() => [['Category 1'], ['Category 2']]),
@@ -8939,7 +8787,7 @@ describe('highcharts_renderer', () => {
8939
8787
  rows: { 0: { type: 'Date' }, 1: { type: 'Date' } },
8940
8788
  cols: { 0: { type: 'Category' }, 1: { type: 'Category' } }
8941
8789
  };
8942
-
8790
+
8943
8791
  const opts = {
8944
8792
  chartOptions: {
8945
8793
  label_pie: {
@@ -8951,11 +8799,11 @@ describe('highcharts_renderer', () => {
8951
8799
  }
8952
8800
  }
8953
8801
  };
8954
-
8802
+
8955
8803
  const drilldownFunc = jest.fn();
8956
8804
 
8957
8805
  highchartsRenderer.ptRenderPieWithDrillDown(pivotData, opts, drilldownFunc);
8958
-
8806
+
8959
8807
  const expectedChartOptions = {
8960
8808
  chart: {
8961
8809
  type: 'pie',
@@ -8964,7 +8812,7 @@ describe('highcharts_renderer', () => {
8964
8812
  drillup: expect.any(Function)
8965
8813
  }
8966
8814
  },
8967
- colors: ["#91e7e7", "#f37789", "#ffdc65", "#0e569d", "#bbe0ff", "#57b2ff", "#5ecfb9", "#c7ffda", "#179ab9", "#008aff"],
8815
+ colors: ["#91e7e7", "#f37789", "#ffdc65", "#0e569d", "#bbe0ff", "#57b2ff", "#5ecfb9", "#c7ffda", "#179ab9", "#008aff"],
8968
8816
  plotOptions: {
8969
8817
  series: {
8970
8818
  animation: true,
@@ -8974,7 +8822,7 @@ describe('highcharts_renderer', () => {
8974
8822
  enabled: true,
8975
8823
  formatter: expect.any(Function),
8976
8824
  style: {
8977
- "fontFamily": "Poppins",
8825
+ "fontFamily": "Poppins",
8978
8826
  "fontSize": "11",
8979
8827
  "fontWeight": "normal"
8980
8828
  }
@@ -8986,7 +8834,7 @@ describe('highcharts_renderer', () => {
8986
8834
  headerFormat: '',
8987
8835
  pointFormatter: expect.any(Function)
8988
8836
  },
8989
- series: [{ name: 'Sample Series', data: [1, 2, 3] }],
8837
+ series: [{ name: 'Sample Series', data: [1, 2, 3] }],
8990
8838
  legend: {
8991
8839
  align: "right",
8992
8840
  borderWidth: 0,
@@ -8996,7 +8844,7 @@ describe('highcharts_renderer', () => {
8996
8844
  verticalAlign: "top",
8997
8845
  y: 13
8998
8846
  },
8999
- drilldown: {},
8847
+ drilldown: {},
9000
8848
  subtitle: {
9001
8849
  align: "center",
9002
8850
  style: {
@@ -9028,7 +8876,7 @@ describe('highcharts_renderer', () => {
9028
8876
  getRowKeys: jest.fn(() => [['Row 1'], ['Row 2']]),
9029
8877
  getAggregator: jest.fn(() => ({ value: jest.fn(() => 100) }))
9030
8878
  };
9031
-
8879
+
9032
8880
  const opts = {
9033
8881
  chartOptions: {
9034
8882
  label_pie: { show: true, overlap: true },
@@ -9037,19 +8885,19 @@ describe('highcharts_renderer', () => {
9037
8885
  },
9038
8886
  drillDownListFunc: jest.fn()
9039
8887
  };
9040
-
8888
+
9041
8889
  beforeEach(() => {
9042
8890
  jest.spyOn(highchartsRenderer, 'ptCreateElementAndDraw').mockImplementation(() => {});
9043
8891
  jest.spyOn(highchartsRenderer, 'getFormattedColKey').mockImplementation((name) => `Formatted ${name}`);
9044
8892
  });
9045
-
8893
+
9046
8894
  afterEach(() => {
9047
8895
  jest.restoreAllMocks();
9048
8896
  });
9049
-
8897
+
9050
8898
  it('should call ptCreateElementAndDraw with correct chart options', () => {
9051
8899
  highchartsRenderer.ptRenderBasicPie(pivotData, opts);
9052
-
8900
+
9053
8901
  expect(highchartsRenderer.ptCreateElementAndDraw).toHaveBeenCalledWith(
9054
8902
  expect.objectContaining({
9055
8903
  chart: expect.objectContaining({
@@ -9504,7 +9352,7 @@ describe('highcharts_renderer', () => {
9504
9352
  pivotData.getAggregator().value.mockReturnValue(10);
9505
9353
  highchartsRenderer.getOthersName.mockReturnValue('Others');
9506
9354
  highchartsRenderer.getFormattedColKey.mockReturnValue('FormattedKey');
9507
-
9355
+
9508
9356
  const result = highchartsRenderer.ptCreateSeriesToDrillDownChart(pivotData, chartOptions, additionOptions, opts);
9509
9357
  expect(result[0].data[0].initialName).toEqual('\u200Eשלום');
9510
9358
  });
@@ -9515,11 +9363,11 @@ describe('highcharts_renderer', () => {
9515
9363
  pivotData.getAggregator().value.mockReturnValue(10);
9516
9364
  highchartsRenderer.getOthersName.mockReturnValue('Others');
9517
9365
  highchartsRenderer.getFormattedColKey.mockReturnValue('FormattedKey');
9518
-
9366
+
9519
9367
  const result = highchartsRenderer.ptCreateSeriesToDrillDownChart(pivotData, chartOptions, additionOptions, opts);
9520
9368
  expect(result[0].data[0].initialName).toEqual('Others');
9521
9369
  });
9522
-
9370
+
9523
9371
  it('should handle negative values when chart type is not pie', () => {
9524
9372
  chartOptions.chart.type = 'notPie';
9525
9373
  pivotData.getColKeys.mockReturnValue(['key1']);
@@ -9527,25 +9375,25 @@ describe('highcharts_renderer', () => {
9527
9375
  pivotData.getAggregator().value.mockReturnValue(-10);
9528
9376
  highchartsRenderer.getOthersName.mockReturnValue('Others');
9529
9377
  highchartsRenderer.getFormattedColKey.mockReturnValue('FormattedKey');
9530
-
9378
+
9531
9379
  const result = highchartsRenderer.ptCreateSeriesToDrillDownChart(pivotData, chartOptions, additionOptions, opts);
9532
9380
  expect(result[0].data[0].y).toEqual(-10);
9533
9381
  });
9534
-
9382
+
9535
9383
  it('should handle numeric keys', () => {
9536
9384
  pivotData.getColKeys.mockReturnValue(['123']);
9537
9385
  pivotData.getRowKeys.mockReturnValue(['row1']);
9538
9386
  pivotData.getAggregator().value.mockReturnValue(10);
9539
9387
  highchartsRenderer.getOthersName.mockReturnValue('Others');
9540
9388
  highchartsRenderer.getFormattedColKey.mockReturnValue('FormattedKey');
9541
-
9389
+
9542
9390
  const result = highchartsRenderer.ptCreateSeriesToDrillDownChart(pivotData, chartOptions, additionOptions, opts);
9543
9391
  expect(result[0].data[0].drilldown).toEqual(123);
9544
9392
  });
9545
9393
  });
9546
9394
 
9547
9395
  describe('Function getDataLabelsStylesForDrillDown', () => {
9548
-
9396
+
9549
9397
  it('should return an object with activeDataLabelStyle containing color from dataLabels', () => {
9550
9398
  const mockColor = 'red';
9551
9399
  const additionalOptions = {