Skip to content

Commit 8a512c9

Browse files
committed
test: update test case
1 parent e71643c commit 8a512c9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+97
-423
lines changed

__tests__/plots/bubble.spec.tsx

Lines changed: 0 additions & 14 deletions
This file was deleted.

__tests__/plots/bullet.spec.tsx

Lines changed: 48 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,55 @@
11
import { mount } from '@vue/test-utils'
22
import BulletChart from '../../src/plots/bullet'
33

4+
const props: any = {
5+
data: [
6+
{
7+
title: '满意度',
8+
ranges: [100],
9+
measures: [80],
10+
target: 85,
11+
},
12+
],
13+
measureField: 'measures',
14+
rangeField: 'ranges',
15+
targetField: 'target',
16+
xField: 'title',
17+
style: {
18+
range: {
19+
color: '#5B8FF9',
20+
},
21+
measure: {
22+
color: '#5B8FF9',
23+
},
24+
target: {
25+
color: '#5B8FF9',
26+
},
27+
},
28+
xAxis: {
29+
line: null,
30+
},
31+
yAxis: false,
32+
// 自定义 legend
33+
legend: {
34+
custom: true,
35+
position: 'left',
36+
items: [
37+
{
38+
value: '实际值',
39+
name: '实际值',
40+
marker: { symbol: 'square', style: { fill: '#5B8FF9', r: 5 } },
41+
},
42+
{
43+
value: '目标值',
44+
name: '目标值',
45+
marker: { symbol: 'line', style: { stroke: '#5B8FF9', r: 5 } },
46+
},
47+
],
48+
},
49+
}
50+
451
describe('BulletChart', () => {
552
test('should render without crashed', () => {
6-
mount(BulletChart, {
7-
props: {},
8-
})
53+
mount(() => <BulletChart {...props} />)
954
})
1055
})

__tests__/plots/calendar.spec.tsx

Lines changed: 0 additions & 16 deletions
This file was deleted.

__tests__/plots/column-line.spec.tsx

Lines changed: 0 additions & 10 deletions
This file was deleted.

__tests__/plots/density-heatmap.spec.tsx

Lines changed: 0 additions & 10 deletions
This file was deleted.

__tests__/plots/density.spec.tsx

Lines changed: 0 additions & 10 deletions
This file was deleted.

__tests__/plots/donut.spec.tsx

Lines changed: 0 additions & 10 deletions
This file was deleted.

__tests__/plots/dual-line.spec.tsx

Lines changed: 0 additions & 10 deletions
This file was deleted.

__tests__/plots/fan-guage.spec.tsx

Lines changed: 0 additions & 10 deletions
This file was deleted.

__tests__/plots/funnel.spec.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
import { mount } from '@vue/test-utils'
2-
import Chart from '../../src/plots/funnel'
2+
import FunnelChart from '../../src/plots/funnel'
33

4-
describe('Chart', () => {
4+
describe('FunnelChart', () => {
55
test('should render without crashed', () => {
6-
mount(Chart, {
7-
props: {},
8-
})
6+
mount(() => <FunnelChart data={[{ x: 'a', y: 1 }]} xField="x" yField="y" />)
97
})
108
})

0 commit comments

Comments
 (0)