@@ -4376,7 +4376,21 @@ describe('hovermode: (x|y)unified', function() {
43764376
43774377 assertRectColor ( bgcolor [ 2 ] , bgcolor [ 2 ] ) ;
43784378
4379- // Finally, check that a hoverlabel.bgcolor defined in template wins
4379+ // Check that a legend.bgcolor defined in template works
4380+ delete mockCopy . layout ;
4381+ mockCopy . layout = {
4382+ hovermode : 'x unified' ,
4383+ template : { layout : { legend : { bgcolor : bgcolor [ 1 ] , bordercolor : bgcolor [ 1 ] } } }
4384+ } ;
4385+
4386+ return Plotly . newPlot ( gd , mockCopy ) ;
4387+ } )
4388+ . then ( function ( gd ) {
4389+ _hover ( gd , { xval : 3 } ) ;
4390+
4391+ assertRectColor ( bgcolor [ 1 ] , bgcolor [ 1 ] ) ;
4392+
4393+ // Check that a hoverlabel.bgcolor defined in template wins
43804394 delete mockCopy . layout ;
43814395 mockCopy . layout = {
43824396 hovermode : 'x unified' ,
@@ -4431,6 +4445,20 @@ describe('hovermode: (x|y)unified', function() {
44314445
44324446 assertFont ( 'Arial' , '22px' , 'rgb(30, 30, 30)' ) ;
44334447
4448+ // Check that a legend.font defined in template wins
4449+ delete mockCopy . layout ;
4450+ mockCopy . layout = {
4451+ hovermode : 'x unified' ,
4452+ template : { layout : { legend : { font : { size : 5 , family : 'Mono' , color : 'rgb(5, 5, 5)' } } } } ,
4453+ } ;
4454+
4455+ return Plotly . newPlot ( gd , mockCopy ) ;
4456+ } )
4457+ . then ( function ( ) {
4458+ _hover ( gd , { xval : 3 } ) ;
4459+
4460+ assertFont ( 'Mono' , '5px' , 'rgb(5, 5, 5)' ) ;
4461+
44344462 // Finally, check that a hoverlabel.font defined in template wins
44354463 delete mockCopy . layout ;
44364464 mockCopy . layout = {
0 commit comments