@@ -2,7 +2,8 @@ import React, { createRef } from 'react'
22import ReactDOM from 'react-dom'
33import LineChart from '../../src/plots/line'
44import StateManagerProvider from '../../src/components/state-manager'
5- import { StateManager } from '@antv/g2plot'
5+ import { StateManager , LineConfig } from '@antv/g2plot'
6+ import BasePlot from '@antv/g2plot/lib/base/plot'
67
78describe ( 'LineChart' , ( ) => {
89 test ( 'render without crashed' , ( ) => {
@@ -11,8 +12,8 @@ describe('LineChart', () => {
1112 } )
1213
1314 test ( 'object ref should be assigned' , ( ) => {
14- const ref = createRef < any > ( )
15- const chartRef = createRef ( )
15+ const ref = createRef < HTMLDivElement | null > ( )
16+ const chartRef = createRef < BasePlot < LineConfig > | null > ( )
1617 const div = document . createElement ( 'div' )
1718 ReactDOM . render ( < LineChart data = { [ ] } ref = { ref } chartRef = { chartRef } /> , div )
1819 expect ( ref . current ) . toBeDefined ( )
@@ -25,7 +26,7 @@ describe('LineChart', () => {
2526 expect ( instance ) . toBeTruthy ( )
2627 }
2728 const div = document . createElement ( 'div' )
28- ReactDOM . render ( < LineChart data = { [ ] } ref = { getChart } /> , div )
29+ ReactDOM . render ( < LineChart data = { [ ] } chartRef = { getChart } /> , div )
2930
3031 // expect(chart).toBeDefined()
3132 } )
0 commit comments