@@ -211,7 +211,7 @@ describe('core', () => {
211
211
212
212
it ( 'getChartSize' , ( ) => {
213
213
createDiv ( '' , document . body , 'changeSize' ) ;
214
- document . getElementById ( 'changeSize' ) . style . width = '0px' ;
214
+ document . getElementById ( 'changeSize' ) ! . style . width = '0px' ;
215
215
const line = new Line ( 'changeSize' , {
216
216
data : partySupport . filter ( ( o ) => o . type === 'FF' ) ,
217
217
xField : 'date' ,
@@ -259,8 +259,8 @@ describe('core', () => {
259
259
260
260
line . render ( ) ;
261
261
262
- expect ( line . chart . getOptions ( ) . axes [ 'date' ] . label . autoRotate ) . toBe ( false ) ;
263
- expect ( line . chart . getOptions ( ) . axes [ 'date' ] . label . autoHide ) . toEqual ( {
262
+ expect ( line . chart . getOptions ( ) . axes ?. [ 'date' ] . label . autoRotate ) . toBe ( false ) ;
263
+ expect ( line . chart . getOptions ( ) . axes ?. [ 'date' ] . label . autoHide ) . toEqual ( {
264
264
type : 'equidistance' ,
265
265
cfg : {
266
266
minGap : 6 ,
@@ -280,8 +280,8 @@ describe('core', () => {
280
280
} ,
281
281
} ) ;
282
282
line . render ( ) ;
283
- expect ( line . chart . getOptions ( ) . axes [ 'date' ] . label . autoRotate ) . toBe ( false ) ;
284
- expect ( line . chart . getOptions ( ) . axes [ 'date' ] . label . autoHide ) . toEqual ( {
283
+ expect ( line . chart . getOptions ( ) . axes ?. [ 'date' ] . label . autoRotate ) . toBe ( false ) ;
284
+ expect ( line . chart . getOptions ( ) . axes ?. [ 'date' ] . label . autoHide ) . toEqual ( {
285
285
type : 'equidistance' ,
286
286
cfg : {
287
287
minGap : 12 ,
@@ -296,14 +296,14 @@ describe('core', () => {
296
296
} ,
297
297
} ) ;
298
298
line . render ( ) ;
299
- expect ( line . chart . getOptions ( ) . axes [ 'date' ] . label . autoRotate ) . toBe ( false ) ;
300
- expect ( line . chart . getOptions ( ) . axes [ 'date' ] . label . autoHide ) . toBe ( false ) ;
299
+ expect ( line . chart . getOptions ( ) . axes ?. [ 'date' ] . label . autoRotate ) . toBe ( false ) ;
300
+ expect ( line . chart . getOptions ( ) . axes ?. [ 'date' ] . label . autoHide ) . toBe ( false ) ;
301
301
302
302
line . destroy ( ) ;
303
303
} ) ;
304
304
305
305
it ( 'default-options' , ( ) => {
306
- type CustomPlotOptions = { } ;
306
+ type CustomPlotOptions = Record < string , any > ;
307
307
class CustomPlot extends Plot < CustomPlotOptions > {
308
308
type : 'custom' ;
309
309
getSchemaAdaptor ( ) {
@@ -338,7 +338,7 @@ describe('core', () => {
338
338
339
339
const annotations = line . chart . getController ( 'annotation' ) . getComponents ( ) ;
340
340
expect ( annotations . length ) . toBe ( 2 ) ;
341
- expect ( annotations . find ( ( co ) => co . extra . id === 'ID' ) . component . get ( 'type' ) ) . toBe ( 'image' ) ;
341
+ expect ( annotations . find ( ( co ) => co . extra . id === 'ID' ) ? .component . get ( 'type' ) ) . toBe ( 'image' ) ;
342
342
343
343
line . addAnnotations ( [ { type : 'image' , start : [ 'min' , 'median' ] , end : [ 'max' , 'median' ] , src : 'xx' } ] ) ;
344
344
expect ( line . chart . getController ( 'annotation' ) . getComponents ( ) . length ) . toBe ( 3 ) ;
0 commit comments