@@ -6144,6 +6144,40 @@ describe('hovermode: (x|y)unified', function() {
6144
6144
. then ( done , done . fail ) ;
6145
6145
} ) ;
6146
6146
6147
+ it ( 'should use hoverlabel.grouptitlefont for group titles' , function ( done ) {
6148
+ function assertFont ( fontFamily , fontSize , fontColor ) {
6149
+ var hover = getHoverLabel ( ) ;
6150
+ var traces = hover . selectAll ( 'g.traces' ) ;
6151
+
6152
+ traces . each ( function ( ) {
6153
+ var e = d3Select ( this ) ;
6154
+ var text = e . select ( 'text.legendtext' ) ;
6155
+ var node = text . node ( ) ;
6156
+ var label = node . innerHTML ;
6157
+ if ( label . indexOf ( 'group' ) !== - 1 ) {
6158
+ var textStyle = window . getComputedStyle ( node ) ;
6159
+ expect ( textStyle . fontFamily . split ( ',' ) [ 0 ] ) . toBe ( fontFamily , 'wrong font family' ) ;
6160
+ expect ( textStyle . fontSize ) . toBe ( fontSize , 'wrong font size' ) ;
6161
+ expect ( textStyle . fill ) . toBe ( fontColor , 'wrong font color' ) ;
6162
+ }
6163
+ } ) ;
6164
+ }
6165
+
6166
+ var mockCopy = Lib . extendDeep ( { } , groupTitlesMock ) ;
6167
+
6168
+ mockCopy . layout . hoverlabel = {
6169
+ grouptitlefont : { size : 20 , family : 'Mono' , color : 'rgb(255, 127, 0)' }
6170
+ } ;
6171
+
6172
+ Plotly . newPlot ( gd , mockCopy )
6173
+ . then ( function ( gd ) {
6174
+ _hover ( gd , { xval : 0 } ) ;
6175
+
6176
+ assertFont ( 'Mono' , '20px' , 'rgb(255, 127, 0)' ) ;
6177
+ } )
6178
+ . then ( done , done . fail ) ;
6179
+ } ) ;
6180
+
6147
6181
it ( 'should work with hovertemplate' , function ( done ) {
6148
6182
var mockCopy = Lib . extendDeep ( { } , mock ) ;
6149
6183
mockCopy . data [ 0 ] . hovertemplate = 'hovertemplate: %{y:0.2f}' ;
0 commit comments