@@ -2,13 +2,14 @@ import React from 'react';
2
2
import { shallow } from 'enzyme' ;
3
3
import RadarChartCard from '../../../components/chart/RadarChartCard' ;
4
4
import ReactApexChart from 'react-apexcharts' ;
5
+ import { CLASSIFICATION } from '../../../reference' ;
5
6
6
7
const labels = [ 'f1_score' , 'accuracy' , 'precision' , 'recall' , 'auc' ] ;
7
8
const values = [ 1 , 0.8 , 0.1 , 0.3 , 0 ] ;
8
9
9
10
describe ( 'RadarChartCard' , ( ) => {
10
11
it ( 'renders with full data' , ( ) => {
11
- const element = shallow ( < RadarChartCard data = { values } labels = { labels } /> ) ;
12
+ const element = shallow ( < RadarChartCard data = { values } labels = { labels } radarType = { CLASSIFICATION } /> ) ;
12
13
expect ( element ) . toBeDefined ( ) ;
13
14
const chartProps = element . find ( ReactApexChart ) . props ( ) ;
14
15
expect ( element . find ( ReactApexChart ) . length ) . toBe ( 1 ) ;
@@ -19,7 +20,7 @@ describe('RadarChartCard', () => {
19
20
} ) ;
20
21
21
22
it ( 'renders without labels' , ( ) => {
22
- const element = shallow ( < RadarChartCard data = { values } labels = { [ ] } /> ) ;
23
+ const element = shallow ( < RadarChartCard data = { values } labels = { [ ] } radarType = { CLASSIFICATION } /> ) ;
23
24
expect ( element ) . toBeDefined ( ) ;
24
25
const chartProps = element . find ( ReactApexChart ) . props ( ) ;
25
26
expect ( element . find ( ReactApexChart ) . length ) . toBe ( 1 ) ;
@@ -28,7 +29,7 @@ describe('RadarChartCard', () => {
28
29
} ) ;
29
30
30
31
it ( 'renders without data' , ( ) => {
31
- const element = shallow ( < RadarChartCard data = { [ ] } labels = { [ ] } /> ) ;
32
+ const element = shallow ( < RadarChartCard data = { [ ] } labels = { [ ] } radarType = { CLASSIFICATION } /> ) ;
32
33
expect ( element ) . toBeDefined ( ) ;
33
34
const chartProps = element . find ( ReactApexChart ) . props ( ) ;
34
35
expect ( element . find ( ReactApexChart ) . length ) . toBe ( 1 ) ;
0 commit comments