@@ -494,6 +494,36 @@ describe('scattermapbox hover', function() {
494494 expect ( out . color ) . toEqual ( '#1f77b4' ) ;
495495 } ) ;
496496
497+ it ( 'should skip over blank and non-string text items' , function ( done ) {
498+ var xval = 11 ,
499+ yval = 11 ,
500+ out ;
501+
502+ Plotly . restyle ( gd , 'text' , [ [ '' , 'B' , 'C' ] ] ) . then ( function ( ) {
503+ out = hoverPoints ( getPointData ( gd ) , xval , yval ) [ 0 ] ;
504+ expect ( out . extraText ) . toEqual ( '(10°, 10°)' ) ;
505+
506+ return Plotly . restyle ( gd , 'text' , [ [ null , 'B' , 'C' ] ] ) ;
507+ } )
508+ . then ( function ( ) {
509+ out = hoverPoints ( getPointData ( gd ) , xval , yval ) [ 0 ] ;
510+ expect ( out . extraText ) . toEqual ( '(10°, 10°)' ) ;
511+
512+ return Plotly . restyle ( gd , 'text' , [ [ false , 'B' , 'C' ] ] ) ;
513+ } )
514+ . then ( function ( ) {
515+ out = hoverPoints ( getPointData ( gd ) , xval , yval ) [ 0 ] ;
516+ expect ( out . extraText ) . toEqual ( '(10°, 10°)' ) ;
517+
518+ return Plotly . restyle ( gd , 'text' , [ [ 'A' , 'B' , 'C' ] ] ) ;
519+ } )
520+ . then ( function ( ) {
521+ out = hoverPoints ( getPointData ( gd ) , xval , yval ) [ 0 ] ;
522+ expect ( out . extraText ) . toEqual ( '(10°, 10°)<br>A' ) ;
523+ } )
524+ . then ( done ) ;
525+ } ) ;
526+
497527 it ( 'should generate hover label info (positive winding case)' , function ( ) {
498528 var xval = 11 + 720 ,
499529 yval = 11 ;
0 commit comments