@@ -4547,17 +4547,6 @@ describe('hovermode: (x|y)unified', function() {
45474547 } ) ;
45484548 }
45494549
4550- function assertFont ( fontFamily , fontSize , fontColor ) {
4551- var hover = getHoverLabel ( ) ;
4552- var text = hover . select ( 'text.legendtext' ) ;
4553- var node = text . node ( ) ;
4554-
4555- var textStyle = window . getComputedStyle ( node ) ;
4556- expect ( textStyle . fontFamily . split ( ',' ) [ 0 ] ) . toBe ( fontFamily , 'wrong font family' ) ;
4557- expect ( textStyle . fontSize ) . toBe ( fontSize , 'wrong font size' ) ;
4558- expect ( textStyle . fill ) . toBe ( fontColor , 'wrong font color' ) ;
4559- }
4560-
45614550 it ( 'set smart defaults for spikeline in x unified' , function ( done ) {
45624551 Plotly . newPlot ( gd , [ { y : [ 4 , 6 , 5 ] } ] , { 'hovermode' : 'x unified' , 'xaxis' : { 'color' : 'red' } } )
45634552 . then ( function ( gd ) {
@@ -6011,6 +6000,17 @@ describe('hovermode: (x|y)unified', function() {
60116000 } ) ;
60126001
60136002 it ( 'should use hoverlabel.font or legend.font or layout.font' , function ( done ) {
6003+ function assertFont ( fontFamily , fontSize , fontColor ) {
6004+ var hover = getHoverLabel ( ) ;
6005+ var text = hover . select ( 'text.legendtext' ) ;
6006+ var node = text . node ( ) ;
6007+
6008+ var textStyle = window . getComputedStyle ( node ) ;
6009+ expect ( textStyle . fontFamily . split ( ',' ) [ 0 ] ) . toBe ( fontFamily , 'wrong font family' ) ;
6010+ expect ( textStyle . fontSize ) . toBe ( fontSize , 'wrong font size' ) ;
6011+ expect ( textStyle . fill ) . toBe ( fontColor , 'wrong font color' ) ;
6012+ }
6013+
60146014 var mockCopy = Lib . extendDeep ( { } , mock ) ;
60156015
60166016 // Set layout.font
0 commit comments