Skip to content

Commit

Permalink
Fix project selector failing test (#780)
Browse files Browse the repository at this point in the history
chore: fix project selector failing test

Signed-off-by: Frank Flitton <[email protected]>
  • Loading branch information
FrankFlitton committed Jun 23, 2023
1 parent 007e636 commit e2fd2a4
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 3 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@
"@typescript-eslint/parser": "^5.48.2",
"babel-loader": "^8.2.5",
"chalk": "^4",
"chart.js": "3.6.2",
"chartjs-plugin-datalabels": "2.0.0",
"cheerio": "^1.0.0-rc.12",
"compression-webpack-plugin": "^9.2.0",
"cookie-parser": "^1.4.3",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,64 @@
import { Chart as ChartJS, registerables, Tooltip } from 'chart.js';
import {
Chart as ChartJS,
// registerables
ArcElement,
LineElement,
BarElement,
PointElement,
BarController,
BubbleController,
DoughnutController,
LineController,
PieController,
PolarAreaController,
RadarController,
ScatterController,
CategoryScale,
LinearScale,
LogarithmicScale,
RadialLinearScale,
TimeScale,
TimeSeriesScale,
Decimation,
Filler,
Legend,
Title,
Tooltip,
SubTitle,
} from 'chart.js';
import ChartDataLabels from 'chartjs-plugin-datalabels';
import { isEqual, isNil } from 'lodash';

ChartJS.register(...registerables, ChartDataLabels);
const registerables = [
ArcElement,
LineElement,
BarElement,
PointElement,
BarController,
BubbleController,
DoughnutController,
LineController,
PieController,
PolarAreaController,
RadarController,
ScatterController,
CategoryScale,
LinearScale,
LogarithmicScale,
RadialLinearScale,
TimeScale,
TimeSeriesScale,
Decimation,
Filler,
Legend,
Title,
Tooltip,
SubTitle,
];

// "registerables" helper was failing tests
registerables.forEach(plugin => ChartJS.register(plugin));
ChartJS.register(ChartDataLabels);

// Create positioner to put tooltip at cursor position
Tooltip.positioners.cursor = function (_chartElements, coordinates) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import * as React from 'react';
import ButtonBase from '@material-ui/core/ButtonBase';
import { makeStyles, Theme } from '@material-ui/core/styles';
import ExpandMore from '@material-ui/icons/ExpandMore';
Expand All @@ -6,7 +7,6 @@ import { KeyCodes } from 'common/constants';
import { useCommonStyles } from 'components/common/styles';
import { listhoverColor } from 'components/Theme/constants';
import { Project } from 'models/Project/types';
import * as React from 'react';
import { SearchableProjectList } from './SearchableProjectList';

const expanderGridHeight = 12;
Expand Down
2 changes: 2 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11705,6 +11705,8 @@ __metadata:
"@typescript-eslint/parser": ^5.48.2
babel-loader: ^8.2.5
chalk: ^4
chart.js: 3.6.2
chartjs-plugin-datalabels: 2.0.0
cheerio: ^1.0.0-rc.12
compression-webpack-plugin: ^9.2.0
cookie-parser: ^1.4.3
Expand Down

0 comments on commit e2fd2a4

Please sign in to comment.