@datarailsshared/dr_renderer 1.2.228-rocket → 1.2.230-dragons

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.
@@ -31,6 +31,12 @@ jobs:
31
31
  - run:
32
32
  name: Authenticate with registry
33
33
  command: echo "//registry.npmjs.org/:_authToken=$npm_TOKEN" > ~/repo/.npmrc
34
+ - run:
35
+ name: Install dependencies
36
+ command: npm install
37
+ - run:
38
+ name: Run npm test
39
+ command: npm test
34
40
  - run:
35
41
  name: Publish package
36
42
  command: npm publish . --access=public
@@ -0,0 +1,3 @@
1
+ module.exports = {
2
+ presets: [['@babel/preset-env', {targets: {node: 'current'}}]],
3
+ };
package/jest.config.js ADDED
@@ -0,0 +1,27 @@
1
+ module.exports = {
2
+ clearMocks: true,
3
+ setupFilesAfterEnv: ['regenerator-runtime/runtime'],
4
+ testPathIgnorePatterns: [
5
+ "/node_modules/",
6
+ ],
7
+ transformIgnorePatterns: [
8
+ "<rootDir>/node_modules/(?!jquery|lodash|moment/)",
9
+ ],
10
+ collectCoverage: true,
11
+ collectCoverageFrom: [
12
+ '**/*.js',
13
+ '!**/*.config.js',
14
+ '!**/build/**',
15
+ '!**/coverage/**',
16
+ '!**/node_modules/**',
17
+ '!**/vendor/**'
18
+ ],
19
+ // coverageThreshold: {
20
+ // "global": {
21
+ // "branches": 100,
22
+ // "functions": 100,
23
+ // "lines": 100,
24
+ // "statements": 100
25
+ // }
26
+ // },
27
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datarailsshared/dr_renderer",
3
- "version": "1.2.228-rocket",
3
+ "version": "1.2.230-dragons",
4
4
  "description": "DataRails charts and tables renderer",
5
5
  "keywords": [
6
6
  "datarails",
@@ -9,7 +9,8 @@
9
9
  "tables"
10
10
  ],
11
11
  "scripts": {
12
- "login": "npm login"
12
+ "login": "npm login",
13
+ "test": "jest --coverage"
13
14
  },
14
15
  "author": "Sergey Spivakov",
15
16
  "repository": {
@@ -17,6 +18,21 @@
17
18
  "url": "git+https://bitbucket.org/datarails/dr_renderer.git"
18
19
  },
19
20
  "license": "",
21
+ "dependencies": {
22
+ "jquery": "^3.6.0",
23
+ "lodash": "^4.17.20",
24
+ "regenerator-runtime": "^0.13.5"
25
+ },
26
+ "devDependencies": {
27
+ "@babel/core": "^7.20.12",
28
+ "@babel/preset-env": "^7.20.2",
29
+ "@testing-library/dom": "^7.2.1",
30
+ "@testing-library/jest-dom": "^5.5.0",
31
+ "babel-jest": "^25.5.1",
32
+ "jest": "^25.3.0",
33
+ "moment": "^2.29.1",
34
+ "serve": "^11.3.0"
35
+ },
20
36
  "bugs": {
21
37
  "url": ""
22
38
  },
@@ -24,5 +40,10 @@
24
40
  "whitelistedNonPeerDependencies": [],
25
41
  "main": "src/index.js",
26
42
  "module": "src/index.js",
27
- "sideEffects": false
43
+ "sideEffects": false,
44
+ "jest": {
45
+ "setupFiles": [
46
+ "./setup-jest.js"
47
+ ]
48
+ }
28
49
  }
@@ -1,5 +1,6 @@
1
1
  const SERIES_CLASSNAMES = {
2
2
  WATERFALL_BREAKDOWN: 'waterfallBreakdown',
3
+ WATERFALL_WALKTHROUGH: 'waterfallWalkthrough',
3
4
  TOTAL_SERIES: 'totalSeries',
4
5
  TREND_SERIES: 'trendSeries',
5
6
  };
@@ -25,6 +26,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
25
26
  const textColor = "#151a41";
26
27
  const chartLabelColor = "#cfd7dd";
27
28
  const HIGHCHARTS_FONT_FAMILY = 'Poppins';
29
+ let firstBarColor = null;
28
30
 
29
31
  if(!Highcharts){
30
32
  Highcharts = {
@@ -82,6 +84,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
82
84
  KPI_WIDGET: 'kpi-widget',
83
85
  TEXT_WIDGET: 'text-widget',
84
86
  WATERFALL_BREAKDOWN: 'waterfall-chart-breakdown',
87
+ WATERFALL_WALKTHROUGH: 'waterfall-chart-walkthrough',
85
88
  PUBLISHED_ITEM: 'published_item',
86
89
  RICH_TEXT: 'rich_text',
87
90
  EXCEL_VIEWER: 'excel_viewer',
@@ -466,7 +469,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
466
469
  highchartsRenderer.getOthersName(opts) :
467
470
  undefined;
468
471
  var drOthersInColumn = lodash.find(
469
- pivotData.getColKeys(),
472
+ pivotData.getColKeys(),
470
473
  keys => keys.length && (lodash.includes(keys, 'DR_Others') || lodash.includes(keys, othersName))
471
474
  );
472
475
 
@@ -486,7 +489,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
486
489
  rows = [];
487
490
  }
488
491
 
489
- var cols = this.key;
492
+ var cols = lodash.get(this, 'point.options.colsForTotal') || this.key;
490
493
  if (typeof (cols) == 'object' && cols.name) {
491
494
  cols = cols.name;
492
495
  }
@@ -494,7 +497,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
494
497
  if (!cols && is_drill_down_pie) {
495
498
  cols = this.point.name;
496
499
  }
497
-
500
+
498
501
  if (drOthersInColumn) {
499
502
  if (!lodash.isArray(cols) && othersName === cols) {
500
503
  cols = ['DR_Others'];
@@ -619,6 +622,8 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
619
622
 
620
623
  var func = function () {
621
624
  const isWaterfallBreakdown = this.series.options.className === SERIES_CLASSNAMES.WATERFALL_BREAKDOWN;
625
+ const isWaterfallWalkthrough = this.series.options.className === SERIES_CLASSNAMES.WATERFALL_WALKTHROUGH;
626
+ const isTrendSeries = this.series.options.className === SERIES_CLASSNAMES.TREND_SERIES;
622
627
 
623
628
  var y = parseFloat(this.y);
624
629
  if (pivotData) {
@@ -629,10 +634,11 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
629
634
  }
630
635
  if (pivotData.rowAttrs.length == 0
631
636
  || this.series.options.className === 'totalSeries'
632
- || this.series.options.className === 'trendSeries') {
637
+ || isTrendSeries) {
633
638
  rows = [];
634
639
  }
635
- var cols = this.key;
640
+
641
+ var cols = lodash.get(this, 'point.options.colsForTotal') || this.key;
636
642
  if (!cols && is_drill_down_pie) {
637
643
  cols = this.name;
638
644
  }
@@ -647,7 +653,9 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
647
653
  if (variant_name && rows && rows[0] && variant_name == rows[0]) {
648
654
  rows[0] = variant_name_default_name;
649
655
  }
650
-
656
+ if (isWaterfallWalkthrough) {
657
+ cols = [this.key]
658
+ }
651
659
  try {
652
660
  if (is_drill_down_pie && !highchartsRenderer.selfStartsWith(series_name,"Series ")) {
653
661
  let temp = cols;
@@ -655,7 +663,9 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
655
663
  rows = temp;
656
664
  }
657
665
 
658
- var category_text = `<span style="font-weight: bold;">${ cols }${ isWaterfallBreakdown ? ': ' : ' ' }</span>`;
666
+ var category_text = `<span style="font-weight: bold;">
667
+ ${ lodash.get(this, 'point.options.colsForTotal') ? cols[0] : cols } ${ isWaterfallBreakdown ? ': ' : ' ' }
668
+ </span>`;
659
669
  if (this.category) {
660
670
  category_text = '';
661
671
  }
@@ -664,7 +674,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
664
674
  series_text += ': '
665
675
  }
666
676
 
667
- if (pivotData.rowAttrs.length == 0) {
677
+ if (pivotData.rowAttrs.length == 0 && !isTrendSeries) {
668
678
  series_text = ': ';
669
679
  }
670
680
 
@@ -672,13 +682,15 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
672
682
  const modifiedRowsAndCols = highchartsRenderer.transformRowsAndColsForBreakdown(rows, cols, this.point, opts);
673
683
  rows = modifiedRowsAndCols.rows;
674
684
  cols = modifiedRowsAndCols.cols;
675
- }
685
+ }
676
686
 
677
687
  var aggr = pivotData.getAggregator(rows, cols);
678
688
 
679
689
  let formatted_value_to_return = $.pivotUtilities.getFormattedNumber(y, null, opts);
680
690
  if (aggr.value() || isWaterfallBreakdown) {
681
- formatted_value_to_return = $.pivotUtilities.getFormattedNumber(isWaterfallBreakdown ? y : aggr.value(), aggr, opts);
691
+ formatted_value_to_return = $.pivotUtilities.getFormattedNumber(
692
+ isWaterfallBreakdown || isTrendSeries ? y : aggr.value(), aggr, opts
693
+ );
682
694
  }
683
695
 
684
696
  let wrappedFormattedValue = highchartsRenderer.getSpanWrapper(formatted_value_to_return);
@@ -1085,7 +1097,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
1085
1097
 
1086
1098
  const trendSeries = lodash.clone(chart_series[chart_series.length - 1]);
1087
1099
  trendSeries.className = 'trendSeries';
1088
- trendSeries.name = 'Trend Line (' + trendSeries.name + ')';
1100
+ trendSeries.name = highchartsRenderer.getTrendSeriesName(trendSeries);
1089
1101
  trendSeries.dashStyle = 'shortdot';
1090
1102
  trendSeries.type = 'line';
1091
1103
  trendSeries.data = trendSeries.data.map((el, index) => a + b * (index + 1));
@@ -1254,7 +1266,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
1254
1266
 
1255
1267
  const trendSeries = lodash.clone(chart_series[chart_series.length - 1]);
1256
1268
  trendSeries.className = 'trendSeries';
1257
- trendSeries.name = 'Trend Line (' + trendSeries.name + ')';
1269
+ trendSeries.name = highchartsRenderer.getTrendSeriesName(trendSeries);
1258
1270
  trendSeries.dashStyle = 'shortdot';
1259
1271
  trendSeries.type = 'line';
1260
1272
  trendSeries.data = trendSeries.data.map((data, index) => ({name: data.name, y: a + b * (index + 1)}));
@@ -1414,6 +1426,89 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
1414
1426
  return chart_series;
1415
1427
  }
1416
1428
 
1429
+ highchartsRenderer.ptCreateWaterfallWalkthroughSeries = function (pivotData, onlyNumbers, additionOptions, opts) {
1430
+ const waterfallOptions = opts.walkthrough_options;
1431
+ const chart_series = [];
1432
+ let resultObject = {
1433
+ data: [],
1434
+ dataLabels: {
1435
+ allowOverlap: additionOptions && additionOptions.label ? additionOptions.label.overlap : false,
1436
+ enabled: additionOptions && additionOptions.label ? additionOptions.label.show : true,
1437
+ formatter: highchartsRenderer.defaultDataLabelFormatter(pivotData, {'chartOptions': additionOptions, total_value_options: opts.total_value_options}),
1438
+ style: highchartsRenderer.getDataLabelsStyle(additionOptions),
1439
+ },
1440
+ upColor: waterfallOptions.colors.increase,
1441
+ color: waterfallOptions.colors.decrease,
1442
+ className: SERIES_CLASSNAMES.WATERFALL_WALKTHROUGH
1443
+ };
1444
+ resultObject = highchartsRenderer.getDataLabelsOptions(additionOptions, resultObject);
1445
+ lodash.forEach(waterfallOptions.values.walkthrough, function(value, index) {
1446
+
1447
+ let keys = [];
1448
+ if (value.trend === 'total') {
1449
+ keys = ['Total'];
1450
+ } else {
1451
+ _.forEach(value.key, (item) => {
1452
+ const findKeyByValue = Object.keys(pivotData.dateValuesDictionary || {}).find(key => pivotData.dateValuesDictionary[key] === item);
1453
+ keys.push(findKeyByValue ? findKeyByValue : item);
1454
+ })
1455
+ }
1456
+
1457
+ const agg = pivotData.getAggregator([], keys);
1458
+ let val = agg.value();
1459
+
1460
+ if (val != null && $.isNumeric(val)) {
1461
+ val = parseFloat(val);
1462
+ } else if (onlyNumbers) {
1463
+ val = NaN;
1464
+ } else {
1465
+ val = 0;
1466
+ }
1467
+
1468
+ if (value.trend === 'decrease') {
1469
+ val = val * -1;
1470
+ }
1471
+
1472
+ const name = value.trend === 'total' ? value.formattedKey || value.key[0] : keys.join(highchartsRenderer.delimer);
1473
+ let color = '';
1474
+ if (value.trend !== 'total') {
1475
+ if (index === 0 && !firstBarColor) {
1476
+ color = waterfallOptions.colors.total;
1477
+ firstBarColor = waterfallOptions.colors.total;
1478
+ } else {
1479
+ color = value.color
1480
+ }
1481
+ } else {
1482
+ color = waterfallOptions.colors.total;
1483
+ }
1484
+
1485
+ resultObject.data.push({
1486
+ y: val,
1487
+ name: lodash.unescape(name).replace('DR_Others', highchartsRenderer.getOthersName(opts)),
1488
+ isSum: value.trend === 'total',
1489
+ isTotal: value.trend === 'total',
1490
+ color,
1491
+ colsForTotal: value.trend === 'total' ? keys : null,
1492
+ });
1493
+ });
1494
+ chart_series.push(resultObject);
1495
+ chart_series.push(
1496
+ {
1497
+ name: 'Positive',
1498
+ visible: false,
1499
+ color: waterfallOptions.colors.increase
1500
+ });
1501
+
1502
+ chart_series.push(
1503
+ {
1504
+ name: 'Negative',
1505
+ visible: false,
1506
+ color: waterfallOptions.colors.decrease
1507
+ });
1508
+
1509
+ return chart_series;
1510
+ }
1511
+
1417
1512
  highchartsRenderer.setChartTypeBySeriesType = function (type, series) {
1418
1513
  const types = {
1419
1514
  'line-chart': 'line',
@@ -1617,7 +1712,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
1617
1712
  highchartsRenderer.getDataLabelsStylesForDrillDown = function(additionOptions) {
1618
1713
  let result = highchartsRenderer.getDataLabelsOptions(additionOptions, { dataLabels: {} });
1619
1714
 
1620
- if (!result.dataLabels) return {};
1715
+ if (!result.dataLabels) return {};
1621
1716
  return {
1622
1717
  activeDataLabelStyle: {
1623
1718
  color: result.dataLabels.color,
@@ -3173,7 +3268,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
3173
3268
 
3174
3269
  highchartsRenderer.ptRenderWaterfallBreakdown = function (pivotData, opts, drilldownFunc, chartType) {
3175
3270
  let chartOptions = {};
3176
- const additionOptions = opts.chartOptions
3271
+ const additionOptions = opts.chartOptions
3177
3272
  ? opts.chartOptions
3178
3273
  : highchartsRenderer.getDefaultValueForChart(highchartsRenderer.CHART_TYPES.WATERFALL_BREAKDOWN);
3179
3274
 
@@ -3272,6 +3367,121 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
3272
3367
  return highchartsRenderer.ptCreateElementAndDraw(chartOptions, opts);
3273
3368
  };
3274
3369
 
3370
+ highchartsRenderer.ptRenderWaterfallWalkthrough = function (pivotData, opts) {
3371
+ let chartOptions = {};
3372
+ const waterfallOptions = opts?.walkthrough_options;
3373
+ const additionOptions = opts.chartOptions
3374
+ ? opts.chartOptions
3375
+ : highchartsRenderer.getDefaultValueForChart(highchartsRenderer.CHART_TYPES.WATERFALL_WALKTHROUGH);
3376
+
3377
+ chartOptions.chart = {
3378
+ type: 'waterfall',
3379
+ zoomType: additionOptions && additionOptions.chart && additionOptions.chart.zoom_type ? additionOptions.chart.zoom_type : 'None',
3380
+ };
3381
+ if (disableAnimation) {
3382
+ chartOptions.chart.animation = false;
3383
+ }
3384
+
3385
+ chartOptions.xAxis = {
3386
+ type: 'category',
3387
+ crosshair: true,
3388
+ min: 0,
3389
+ title: {
3390
+ text : additionOptions && additionOptions.axisX ? additionOptions.axisX.name : '',
3391
+ },
3392
+ uniqueNames: false,
3393
+ };
3394
+
3395
+ highchartsRenderer.setTitleAndSubTitle(chartOptions, opts, additionOptions);
3396
+
3397
+ chartOptions.yAxis = {
3398
+ min: null,
3399
+ max: null,
3400
+ title: {
3401
+ text: additionOptions && additionOptions.axisY ? additionOptions.axisY.name : '',
3402
+ autoylabel: additionOptions && additionOptions.axisY ? additionOptions.axisY.autoylabel : ''
3403
+ },
3404
+ labels: {
3405
+ formatter: highchartsRenderer.defaultValueLabelsFormatter(pivotData, opts)
3406
+ },
3407
+ };
3408
+ if (additionOptions) {
3409
+ highchartsRenderer.setYAxisMinMax(chartOptions.yAxis, additionOptions.axisY);
3410
+ }
3411
+
3412
+ chartOptions.tooltip = {
3413
+ formatter: highchartsRenderer.defaultFormatterToTooltip(pivotData, opts),
3414
+ valueDecimals: 2,
3415
+ };
3416
+
3417
+ highchartsRenderer.handleGridLines(additionOptions, chartOptions);
3418
+
3419
+ if (lodash.get(opts, 'paletteOptions.widgetPalette', null)) {
3420
+ const mc_palette = lodash.find(lodash.get(opts.paletteOptions, 'monochromePalettes', []), { selected: true });
3421
+ chartOptions.colors = mc_palette ? mc_palette.colors : opts.paletteOptions.widgetPalette;
3422
+ } else if (lodash.get(opts, 'paletteOptions.dashboardPalette.colors', null)) {
3423
+ chartOptions.colors = opts.paletteOptions.dashboardPalette.colors;
3424
+ }
3425
+ chartOptions.series = highchartsRenderer
3426
+ .ptCreateWaterfallWalkthroughSeries(pivotData, null, additionOptions, opts);
3427
+
3428
+ chartOptions = highchartsRenderer.prepareAxisX(chartOptions, additionOptions, pivotData.getColKeys());
3429
+ chartOptions.plotOptions = {
3430
+ waterfall: {
3431
+ pointPadding: 0.2,
3432
+ borderWidth: 0,
3433
+ borderRadius: 1,
3434
+ lineWidth: 0,
3435
+ },
3436
+ series: {
3437
+ animation: !disableAnimation,
3438
+ cropThreshold: 1000,
3439
+ dataLabels: {
3440
+ allowOverlap: additionOptions && additionOptions.label ? additionOptions.label.overlap : false,
3441
+ enabled: additionOptions && additionOptions.label ? additionOptions.label.show : true,
3442
+ formatter: highchartsRenderer.defaultDataLabelFormatter(pivotData, opts),
3443
+ style: highchartsRenderer.getDataLabelsStyle(additionOptions),
3444
+ inside: false
3445
+ },
3446
+ events: {
3447
+ legendItemClick: () => {
3448
+ return false;
3449
+ }
3450
+ }
3451
+ }
3452
+ };
3453
+
3454
+ if (opts.drillDownListFunc) {
3455
+ chartOptions.plotOptions.series.cursor = 'pointer';
3456
+ chartOptions.plotOptions.series.point = {
3457
+ events: {
3458
+ click: opts.drillDownListFunc
3459
+ }
3460
+ };
3461
+ }
3462
+ if (waterfallOptions.colors) {
3463
+ chartOptions.legend = highchartsRenderer.getOptionsForLegends(additionOptions, 3, false);
3464
+ chartOptions.legend.useHTML = true;
3465
+ chartOptions.legend.labelFormatter = function() {
3466
+ const name = this.options.className ? 'Total': this.name;
3467
+ const findTotal = _.find(this.options.data, {isTotal: true});
3468
+ const color = findTotal?.color ? findTotal.color : this.color;
3469
+ return '<span style="margin: 5px; vertical-align: middle; display:inline-block; background-color: '+ color + '; width: 12px; height: 12px; border-radius: 50%"></span><span style="color: #000; display: inline-block; margin: 5px; vertical-align: middle;">' + name + '</span>';
3470
+ }
3471
+
3472
+ chartOptions.legend.symbolPadding = 0;
3473
+ chartOptions.legend.symbolWidth = 0;
3474
+ chartOptions.legend.symbolHeight = 0;
3475
+ chartOptions.legend.squareSymbol = false;
3476
+ } else {
3477
+ chartOptions.legend = {
3478
+ enabled: false
3479
+ }
3480
+ }
3481
+
3482
+ return highchartsRenderer.ptCreateElementAndDraw(chartOptions, opts);
3483
+ }
3484
+
3275
3485
  highchartsRenderer.formatFieldValue = function (field, value) {
3276
3486
  let currentType = '';
3277
3487
  let format = field.format;
@@ -4340,6 +4550,17 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
4340
4550
  }
4341
4551
  };
4342
4552
 
4553
+ highchartsRenderer.waterfallConstants = {
4554
+ [highchartsRenderer.CHART_TYPES.WATERFALL_BREAKDOWN]: {
4555
+ minCategoriesCount: 2,
4556
+ maxCategoriesCount: 5,
4557
+ },
4558
+ [highchartsRenderer.CHART_TYPES.WATERFALL_WALKTHROUGH]: {
4559
+ minCategoriesCount: 2,
4560
+ maxCategoriesCount: 10,
4561
+ }
4562
+ };
4563
+
4343
4564
  highchartsRenderer.rhPivotView = function (rowData, options, isTable = false, widget = null) {
4344
4565
  if (!rowData || !rowData) {
4345
4566
  if (options.onlyOptions) {
@@ -4348,10 +4569,15 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
4348
4569
  return null;
4349
4570
  }
4350
4571
 
4351
- if (widget && widget.chart_type === highchartsRenderer.CHART_TYPES.WATERFALL_BREAKDOWN) {
4352
- const breakdownSettings = widget.options.breakdown_options.settings;
4353
- const maxCategories = breakdownSettings.maxCategoriesCount;
4354
- const minCategories = breakdownSettings.minCategoriesCount;
4572
+ const isWaterfall = widget
4573
+ && (
4574
+ widget.chart_type === highchartsRenderer.CHART_TYPES.WATERFALL_BREAKDOWN
4575
+ || widget.chart_type === highchartsRenderer.CHART_TYPES.WATERFALL_WALKTHROUGH
4576
+ );
4577
+
4578
+ if (isWaterfall) {
4579
+ const maxCategories = highchartsRenderer.waterfallConstants[widget.chart_type].maxCategoriesCount;
4580
+ const minCategories = highchartsRenderer.waterfallConstants[widget.chart_type].minCategoriesCount;
4355
4581
  const uniqueCategories = lodash.filter(
4356
4582
  lodash.uniq(
4357
4583
  lodash.map(rowData, row => row[widget.cols[0].name])
@@ -4361,6 +4587,8 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
4361
4587
 
4362
4588
  if (uniqueCategories && (uniqueCategories.length > maxCategories || uniqueCategories.length < minCategories )) {
4363
4589
  options.error_has_occurred = true;
4590
+ const isDateField = widget.cols[0].type === 'Date';
4591
+ const commonMessagePart = `This chart support a selection of ${minCategories}-${maxCategories} items from the category section. `;
4364
4592
  options.error_params = {
4365
4593
  title: 'Data Conflict',
4366
4594
  text: `Please adjust your dashboard's reference date and filter selections as \
@@ -4609,19 +4837,25 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
4609
4837
  return highchartsRenderer.getWeekNumber(dateObj);
4610
4838
  };
4611
4839
 
4612
- highchartsRenderer.check_value_not_for_convert = function (currentgraph, field_name) {
4613
- let val_not_convert = null;
4840
+ highchartsRenderer.check_values_not_for_convert = function (currentgraph, field_name) {
4841
+ let vals_not_convert = [];
4614
4842
  if (lodash.has(currentgraph, "options.chartOptions.delta_column") && currentgraph.options.chartOptions.delta_column) {
4615
4843
  let delta_options = currentgraph.options.chartOptions.delta_column;
4616
4844
  if (delta_options.field == 'series' && currentgraph.rows && currentgraph.rows[0] &&
4617
4845
  currentgraph.rows[0].name == field_name) {
4618
- val_not_convert = delta_options.name;
4846
+ vals_not_convert = [delta_options.name];
4619
4847
  } else if (delta_options.field == 'category' && currentgraph.rows && currentgraph.cols[0] &&
4620
4848
  currentgraph.cols[0].name == field_name) {
4621
- val_not_convert = delta_options.name;
4849
+ vals_not_convert = [delta_options.name];
4622
4850
  }
4851
+ } else if (currentgraph.chart_type === highchartsRenderer.CHART_TYPES.WATERFALL_WALKTHROUGH) {
4852
+ lodash.forEach(currentgraph.options.walkthrough_options.values.walkthrough, value => {
4853
+ if (value.trend === 'total') {
4854
+ vals_not_convert.push(value.key[0]);
4855
+ }
4856
+ });
4623
4857
  }
4624
- return val_not_convert;
4858
+ return vals_not_convert;
4625
4859
  };
4626
4860
 
4627
4861
  highchartsRenderer.updateFiltersShowNames = function (filters) {
@@ -4641,8 +4875,8 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
4641
4875
  })
4642
4876
  };
4643
4877
 
4644
- highchartsRenderer.returnRawDataValue = function (type, value, format, field_name, val_not_for_convert) {
4645
- if (val_not_for_convert && val_not_for_convert == value) {
4878
+ highchartsRenderer.returnRawDataValue = function (type, value, format, field_name, vals_not_for_convert) {
4879
+ if (vals_not_for_convert && vals_not_for_convert.length && lodash.includes(vals_not_for_convert, value)) {
4646
4880
  return value;
4647
4881
  }
4648
4882
 
@@ -4738,7 +4972,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
4738
4972
  };
4739
4973
 
4740
4974
  highchartsRenderer.isSystemField = function (field) {
4741
- var regex = new RegExp("^(Calc_Model_Name|Calc_Model_ID|Parent_Name|Parent_Id|FileBox_ID|FileBox_Name|DataMapper_Name|Doc_ID|Doc_version|Label|Submission_Date|User|table_id|Latest_In_Dim|Tab_name|CP_Name|DT_.+|VT_.+|System_.+)$", "m");
4975
+ var regex = new RegExp("^(Parent_Name|Parent_Id|FileBox_ID|FileBox_Name|DataMapper_Name|Doc_ID|Doc_version|Label|Submission_Date|User|table_id|Latest_In_Dim|Tab_name|CP_Name|DT_.+|VT_.+|System_.+)$", "m");
4742
4976
 
4743
4977
  return (field.category && field.category.includes("")) || regex.test(field.name)
4744
4978
  };
@@ -5101,55 +5335,34 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
5101
5335
 
5102
5336
  highchartsRenderer.addTemplateDataToCalcModel = function (selectedTemplate, calcModelOptions) {
5103
5337
  highchartsRenderer.setWidgetFieldsToTemplate(selectedTemplate);
5338
+
5339
+ const scenarioName = 'scenario';
5104
5340
  const fields = highchartsRenderer.objectCopyJsonMethod(selectedTemplate.fields);
5105
- const filters = (calcModelOptions.config && calcModelOptions.config.filters) || [];
5341
+ const fieldScenarioAlias = _.find(fields, field => (field.alias || '').toLowerCase() === scenarioName)
5342
+ const fieldScenario = _.find(fields, field => (field.name || '').toLowerCase() === scenarioName)
5343
+ const filters = calcModelOptions.config && calcModelOptions.config.filters;
5344
+
5345
+ const filterFields = [];
5346
+ const valueFields = [];
5347
+ const dateFields = [];
5348
+ const dataTypeFields = [];
5349
+ const dataSeriesFields = [];
5350
+
5351
+ let scenarioField = lodash.get(calcModelOptions, 'config.scenario', undefined) || fieldScenarioAlias || fieldScenario;
5352
+ let fieldOb;
5106
5353
 
5107
- const fillData = (fieldsArr) => {
5108
- const destinationArr = [];
5354
+ const fillData = (fieldsArr, destinationArr) => {
5109
5355
  lodash.forEach(fieldsArr, function (valObj) {
5110
- const fieldOb = lodash.find(fields, { id: valObj.id });
5356
+ fieldOb = lodash.find(fields, { id: valObj.id });
5111
5357
  if (fieldOb) {
5112
5358
  destinationArr.push(fieldOb);
5113
5359
  lodash.remove(fields, { id: fieldOb.id });
5114
5360
  }
5115
5361
  });
5116
-
5117
- return destinationArr;
5118
- }
5119
-
5120
- const predefinedField = {
5121
- value: {
5122
- regex: /posting[_\s]?amount/i,
5123
- fieldWithAlias: undefined,
5124
- fieldWithName: undefined
5125
- },
5126
- dataType: {
5127
- regex: /data[_\s]?type/i,
5128
- fieldWithAlias: undefined,
5129
- fieldWithName: undefined
5130
- },
5131
- date: {
5132
- regex: /reporting[_\s]?month/i,
5133
- fieldWithAlias: undefined,
5134
- fieldWithName: undefined
5135
- },
5136
- filters: {
5137
- regex: /scenario/i,
5138
- fieldWithAlias: undefined,
5139
- fieldWithName: undefined
5140
- },
5141
- };
5142
-
5143
- for (const key in predefinedField) {
5144
- predefinedField[key].fieldWithAlias = _.find(fields, field => predefinedField[key].regex.test((field.alias || '').toLowerCase()));
5145
-
5146
- if (!predefinedField[key].fieldWithAlias) {
5147
- predefinedField[key].fieldWithName = _.find(fields, field => predefinedField[key].regex.test((field.name || '').toLowerCase()));
5148
- }
5149
5362
  }
5150
5363
 
5151
5364
  lodash.forEach(filters, function (filterObj) {
5152
- const fieldOb = lodash.find(fields, { id: filterObj.id });
5365
+ fieldOb = lodash.find(fields, { id: filterObj.id });
5153
5366
  if (!fieldOb) return;
5154
5367
 
5155
5368
  filterObj.values = filterObj.values && lodash.map(filterObj.values, highchartsRenderer.decodeFunc);
@@ -5168,16 +5381,15 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
5168
5381
  });
5169
5382
 
5170
5383
  const storedGroupByFields = lodash.get(calcModelOptions, 'config.group_by', []);
5171
- const storedDateFields = [lodash.get(calcModelOptions, 'config.date_field', predefinedField.date.fieldWithAlias || predefinedField.date.fieldWithName)].filter(f => !!f);
5172
- const storedAggFields = [lodash.get(calcModelOptions, 'config.agg_field', predefinedField.value.fieldWithAlias || predefinedField.value.fieldWithName)].filter(f => !!f);
5173
- const storedDataTypeFields = [lodash.get(calcModelOptions, 'config.data_type_field', predefinedField.dataType.fieldWithAlias || predefinedField.dataType.fieldWithName)].filter(f => !!f);
5174
- const scenarioField = lodash.get(calcModelOptions, 'config.scenario', predefinedField.filters.fieldWithAlias || predefinedField.filters.fieldWithName);
5384
+ const storedDateFields = [lodash.get(calcModelOptions, 'config.date_field', undefined)].filter(f => !!f);
5385
+ const storedAggFields = [lodash.get(calcModelOptions, 'config.agg_field', undefined)].filter(f => !!f);
5386
+ const storedDataTypeFields = [lodash.get(calcModelOptions, 'config.data_type_field', undefined)].filter(f => !!f);
5175
5387
 
5176
- const filterFields = fillData(filters);
5177
- const valueFields = fillData(storedAggFields);
5178
- const dateFields = fillData(storedDateFields);
5179
- const dataTypeFields = fillData(storedDataTypeFields);
5180
- const dataSeriesFields = fillData(storedGroupByFields);
5388
+ fillData(storedGroupByFields, dataSeriesFields);
5389
+ fillData(storedDateFields, dateFields);
5390
+ fillData(storedAggFields, valueFields);
5391
+ fillData(storedDataTypeFields, dataTypeFields);
5392
+ fillData(filters, filterFields);
5181
5393
 
5182
5394
  calcModelOptions.pivot = {
5183
5395
  fieldsArray: fields,
@@ -5685,7 +5897,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
5685
5897
  return valToReturn;
5686
5898
  };
5687
5899
 
5688
-
5900
+
5689
5901
  highchartsRenderer.getChartAxisLabel = function(type) {
5690
5902
  return highchartsRenderer.chartsTypesInfo[type] ? highchartsRenderer.chartsTypesInfo[type].axisName : CHART_AXIS_DEFAULT_LABEL;
5691
5903
  };
@@ -6520,7 +6732,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
6520
6732
  value_name: 'show',
6521
6733
  default_value: true,
6522
6734
  disabled_str: '!{var}.show_out_of_x_axis && !{var}.show_out_of_data_series && !{var}.show_value && !{var}.show_x_axis && !{var}.show_data_series',
6523
- disabled_fn: (value) => !value.show_out_of_x_axis
6735
+ disabled_fn: (value) => !value.show_out_of_x_axis
6524
6736
  && !value.show_out_of_data_series
6525
6737
  && !value.show_value
6526
6738
  && !value.show_x_axis
@@ -6561,8 +6773,8 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
6561
6773
  element_label: '[X Axis]',
6562
6774
  value_name: 'show_x_axis',
6563
6775
  default_value: true,
6564
- clickFn: (value) => value.show = value.show
6565
- ? value.show_out_of_x_axis || value.show_out_of_data_series || value.show_value || value.show_x_axis || value.show_data_series
6776
+ clickFn: (value) => value.show = value.show
6777
+ ? value.show_out_of_x_axis || value.show_out_of_data_series || value.show_value || value.show_x_axis || value.show_data_series
6566
6778
  : value.show,
6567
6779
  },
6568
6780
  {
@@ -6570,8 +6782,8 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
6570
6782
  element_label: '[Data Series]',
6571
6783
  value_name: 'show_data_series',
6572
6784
  default_value: true,
6573
- clickFn: (value) => value.show = value.show
6574
- ? value.show_out_of_x_axis || value.show_out_of_data_series || value.show_value || value.show_x_axis || value.show_data_series
6785
+ clickFn: (value) => value.show = value.show
6786
+ ? value.show_out_of_x_axis || value.show_out_of_data_series || value.show_value || value.show_x_axis || value.show_data_series
6575
6787
  : value.show,
6576
6788
  },
6577
6789
  {
@@ -6579,8 +6791,8 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
6579
6791
  element_label: 'Value',
6580
6792
  value_name: 'show_value',
6581
6793
  default_value: true,
6582
- clickFn: (value) => value.show = value.show
6583
- ? value.show_out_of_x_axis || value.show_out_of_data_series || value.show_value || value.show_x_axis || value.show_data_series
6794
+ clickFn: (value) => value.show = value.show
6795
+ ? value.show_out_of_x_axis || value.show_out_of_data_series || value.show_value || value.show_x_axis || value.show_data_series
6584
6796
  : value.show,
6585
6797
  },
6586
6798
  {
@@ -6588,8 +6800,8 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
6588
6800
  element_label: '% Out of [X Axis]',
6589
6801
  value_name: 'show_out_of_x_axis',
6590
6802
  default_value: false,
6591
- clickFn: (value) => value.show = value.show
6592
- ? value.show_out_of_x_axis || value.show_out_of_data_series || value.show_value || value.show_x_axis || value.show_data_series
6803
+ clickFn: (value) => value.show = value.show
6804
+ ? value.show_out_of_x_axis || value.show_out_of_data_series || value.show_value || value.show_x_axis || value.show_data_series
6593
6805
  : value.show,
6594
6806
  },
6595
6807
  {
@@ -6597,8 +6809,8 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
6597
6809
  element_label: '% Out of [Data Series]',
6598
6810
  value_name: 'show_out_of_data_series',
6599
6811
  default_value: false,
6600
- clickFn: (value) => value.show = value.show
6601
- ? value.show_out_of_x_axis || value.show_out_of_data_series || value.show_value || value.show_x_axis || value.show_data_series
6812
+ clickFn: (value) => value.show = value.show
6813
+ ? value.show_out_of_x_axis || value.show_out_of_data_series || value.show_value || value.show_x_axis || value.show_data_series
6602
6814
  : value.show,
6603
6815
  },
6604
6816
  ]
@@ -6772,16 +6984,16 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
6772
6984
  value_name: 'name',
6773
6985
  element_label: 'Name',
6774
6986
  default_value: '_Variance'
6775
- }, {
6776
- element_type: 'input',
6777
- value_name: 'formula',
6778
- element_label: 'Formula',
6779
- default_value: 'x2-x1'
6780
6987
  }, {
6781
6988
  element_type: 'input',
6782
- value_name: 'color',
6783
- element_label: 'Color',
6784
- default_value: ''
6989
+ value_name: 'formula',
6990
+ element_label: 'Formula',
6991
+ default_value: 'x2-x1'
6992
+ }, {
6993
+ element_type: 'input',
6994
+ value_name: 'color',
6995
+ element_label: 'Color',
6996
+ default_value: ''
6785
6997
  }, {
6786
6998
  element_type: 'radio',
6787
6999
  value_name: 'chart',
@@ -6904,7 +7116,17 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
6904
7116
  axisTooltipDescription: 'The category (usually an independent variable) is shown on the x-axis and should be between 2 to 5 total columns. ',
6905
7117
  legendTooltipTitle: 'Drag one field to further configure your x-axis.',
6906
7118
  legendTooltipDescription: 'The breakdown subdivides the chart by a category field for further analysis of what’s contributing to the increase or decrease.',
6907
- },
7119
+ },
7120
+ [highchartsRenderer.CHART_TYPES.WATERFALL_WALKTHROUGH]: {
7121
+ name: 'Waterfall Walkthrough Chart ',
7122
+ label: 'Waterfall Walkthrough Chart ',
7123
+ title: 'TODO: add text',
7124
+ description: 'TODO: add text',
7125
+ axisName: 'Category',
7126
+ startedMessage: 'TODO: add text',
7127
+ axisTooltipTitle: 'TODO: add text',
7128
+ legendTooltipTitle: 'TODO: add text',
7129
+ },
6908
7130
  'combo-chart': {
6909
7131
  name: 'Combo Chart ',
6910
7132
  label: 'Combo Chart ',
@@ -7560,6 +7782,24 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
7560
7782
  highchartsRenderer.suboptions["legends"],
7561
7783
  ]
7562
7784
  },
7785
+ {
7786
+ type: highchartsRenderer.CHART_TYPES.WATERFALL_WALKTHROUGH,
7787
+ name: highchartsRenderer.chartsTypesInfo[highchartsRenderer.CHART_TYPES.WATERFALL_WALKTHROUGH].name,
7788
+ class: 'google-visualization-charteditor-thumbs-columnchart',
7789
+ render: highchartsRenderer.ptRenderWaterfallWalkthrough,
7790
+ suboptions: [
7791
+ highchartsRenderer.suboptions["axisX"],
7792
+ highchartsRenderer.suboptions["tooltips"],
7793
+ highchartsRenderer.suboptions["label"],
7794
+ highchartsRenderer.suboptions["subtitle"],
7795
+ highchartsRenderer.suboptions["widget_library"],
7796
+ highchartsRenderer.suboptions["chart"],
7797
+ highchartsRenderer.suboptions["negative_number_format"],
7798
+ highchartsRenderer.suboptions["advanced"],
7799
+ highchartsRenderer.suboptions["legends"],
7800
+ ],
7801
+ hidden: true,
7802
+ },
7563
7803
  ]
7564
7804
  },
7565
7805
  ];
@@ -7716,7 +7956,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
7716
7956
  _.forEach(Object.keys(dates), key => {
7717
7957
  const dateConfiguration = dates[key];
7718
7958
  const timestamp = dateConfiguration.timestamp;
7719
- if (timestamp) {
7959
+ if (timestamp) {
7720
7960
  const dateTzOffsetInSeconds = new Date(timestamp * 1000).getTimezoneOffset() * 60;
7721
7961
  dateConfiguration.displayedValue = new Date((timestamp + dateTzOffsetInSeconds) * 1000)
7722
7962
  .toLocaleDateString();
@@ -8015,7 +8255,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
8015
8255
  if (!(format && highchartsRenderer.isDateFormat(dateString, format) || highchartsRenderer.isDate(dateString))) {
8016
8256
  return null;
8017
8257
  }
8018
- const utcDate = format
8258
+ const utcDate = format
8019
8259
  ? moment_lib.utc(dateString, format, true)
8020
8260
  : moment_lib.utc(dateString);
8021
8261
  return utcDate.startOf('day').unix();
@@ -8033,7 +8273,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
8033
8273
  }
8034
8274
 
8035
8275
  let filters = [];
8036
-
8276
+
8037
8277
  if (widget.chart_type === highchartsRenderer.CHART_TYPES.WATERFALL_BREAKDOWN) {
8038
8278
  const colFilter = highchartsRenderer.createFilterObject(widget.cols[0]);
8039
8279
  const labels = [];
@@ -8061,7 +8301,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
8061
8301
  col_value,
8062
8302
  highchartsRenderer.getDateFieldFormat(widget, widget.cols[index])
8063
8303
  );
8064
-
8304
+
8065
8305
  if ($.isEmptyObject(datetrange)) {
8066
8306
  return;
8067
8307
  }
@@ -8304,7 +8544,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
8304
8544
  var data = res;
8305
8545
 
8306
8546
  lodash.forEach(datesFields, function (row) {
8307
- row.val_not_convert = highchartsRenderer.check_value_not_for_convert(widget, row.name);
8547
+ row.val_not_convert = highchartsRenderer.check_values_not_for_convert(widget, row.name);
8308
8548
  });
8309
8549
 
8310
8550
  if (datesFields.length > 0) {
@@ -8710,14 +8950,14 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
8710
8950
  return rightPosition;
8711
8951
  case 'none':
8712
8952
  return none;
8953
+ }
8954
+ } else if (isLine) {
8955
+ return useNewUx ? leftPosition : rightPosition;
8956
+ } else if (isPie) {
8957
+ return useNewUx ? rightPosition : topPosition;
8713
8958
  }
8714
- } else if (isLine) {
8715
- return useNewUx ? leftPosition : rightPosition;
8716
- } else if (isPie) {
8717
- return useNewUx ? rightPosition : topPosition;
8718
- }
8719
8959
 
8720
- return useNewUx ? topPosition : bottomPosition;
8960
+ return useNewUx ? topPosition : bottomPosition;
8721
8961
  }
8722
8962
 
8723
8963
  highchartsRenderer.setYAxisMinMax = function (yAxis, axisYOptions) {
@@ -8732,7 +8972,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
8732
8972
  }
8733
8973
 
8734
8974
  highchartsRenderer.getDateFieldFormat = function(widget, dateField) {
8735
- const aggregationConfig = widget.options && widget.options.date_aggregation_configs
8975
+ const aggregationConfig = widget.options && widget.options.date_aggregation_configs
8736
8976
  ? _.find(widget.options.date_aggregation_configs, { field_id: dateField.id })
8737
8977
  : null;
8738
8978
 
@@ -8782,7 +9022,12 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
8782
9022
  }
8783
9023
  }
8784
9024
 
9025
+ highchartsRenderer.getTrendSeriesName = function(series) {
9026
+ return series.name ? 'Trend Line (' + series.name + ')' : 'Trend Line';
9027
+ }
9028
+
8785
9029
  return highchartsRenderer;
9030
+
8786
9031
  };
8787
9032
 
8788
9033
  module.exports = getHighchartsRenderer;
@@ -0,0 +1,48 @@
1
+ import * as $ from 'jquery';
2
+ import * as lodash from 'lodash';
3
+ import * as moment from 'moment';
4
+ import initPivotTable from "../src/pivottable";
5
+ import initDRPivotTable from "../src/dr_pivottable";
6
+
7
+ const getHighchartsRenderer = require('../src/highcharts_renderer');
8
+ const DataFormatter = require('../src/dataformatter');
9
+ const DEFAULT_USER_COLORS = {
10
+ colors: ['#008aff', '#91e7e7', '#f37789', '#ffdc65', '#0e569d', '#bbe0ff', '#57b2ff', '#5ecfb9', '#c7ffda', '#179ab9'],
11
+ variance_color: null
12
+ };
13
+
14
+ let highchartsRenderer = {};
15
+ let _window = window;
16
+ let _document = document;
17
+
18
+ describe('highcharts_renderer', () => {
19
+ beforeAll(() => {
20
+ const Highcharts = {
21
+ opt: {},
22
+ setOptions: function(value) {Highcharts.opt = value;},
23
+ numberFormat: function(value) { return value ;},
24
+ getOptions: function() { return Highcharts.opt; }
25
+ };
26
+ _window.DataFormatter = DataFormatter;
27
+ initPivotTable($, _window, _document);
28
+ initDRPivotTable($, _window, _document);
29
+
30
+ highchartsRenderer = getHighchartsRenderer($, _document, Highcharts, DEFAULT_USER_COLORS, highchartsRenderer,
31
+ DataFormatter, lodash, moment, true)
32
+ })
33
+
34
+ describe('function isSystemField', () => {
35
+ it('system name', () => {
36
+ const field = {
37
+ name: 'Doc_ID'
38
+ };
39
+ expect(highchartsRenderer.isSystemField(field)).toBe(true)
40
+ });
41
+ it('not system name', () => {
42
+ const field = {
43
+ name: 'field name'
44
+ };
45
+ expect(highchartsRenderer.isSystemField(field)).toBe(false)
46
+ });
47
+ });
48
+ });