@@ -3779,11 +3779,11 @@ describe('hovermode: (x|y)unified', function() {
3779
3779
3780
3780
assertLabel ( { title : '3' , items : [
3781
3781
'trace 0 : 2' ,
3782
- 'trace 3 : 2' ,
3783
3782
'trace 1 : median: 1' ,
3784
- 'trace 4 : 1 ' ,
3783
+ 'trace 3 : 2 ' ,
3785
3784
'trace 2 : 2' ,
3786
- 'trace 5 : 2'
3785
+ 'trace 5 : 2' ,
3786
+ 'trace 4 : 1'
3787
3787
] } ) ;
3788
3788
} )
3789
3789
. catch ( failTest )
@@ -3812,7 +3812,7 @@ describe('hovermode: (x|y)unified', function() {
3812
3812
. then ( done ) ;
3813
3813
} ) ;
3814
3814
3815
- it ( 'should order items in the same way as the legend' , function ( done ) {
3815
+ it ( 'should have the same traceorder as the legend' , function ( done ) {
3816
3816
var mock = require ( '@mocks/stacked_area.json' ) ;
3817
3817
var mockCopy = Lib . extendDeep ( { } , mock ) ;
3818
3818
mockCopy . layout . hovermode = 'x unified' ;
@@ -3833,6 +3833,25 @@ describe('hovermode: (x|y)unified', function() {
3833
3833
. then ( done ) ;
3834
3834
} ) ;
3835
3835
3836
+ it ( 'should order items based on trace index as in the legend' , function ( done ) {
3837
+ var mock = require ( '@mocks/29.json' ) ;
3838
+ var mockCopy = Lib . extendDeep ( { } , mock ) ;
3839
+ mockCopy . layout . hovermode = 'x unified' ;
3840
+ Plotly . newPlot ( gd , mockCopy )
3841
+ . then ( function ( gd ) {
3842
+ _hover ( gd , { xpx : 400 , ypx : 400 } ) ;
3843
+
3844
+ assertLabel ( { title : 'Apr 13, 2014, 09:51:36' , items : [
3845
+ 'Outdoor (wun... : 63' ,
3846
+ '1st Floor (N... : (Apr 13, 2014, 09:51:34, 69.5)' ,
3847
+ '2nd Floor (R... : (Apr 13, 2014, 09:51:33, 69.125)' ,
3848
+ 'Attic (Ardui... : (Apr 13, 2014, 09:51:37, 68.68)'
3849
+ ] } ) ;
3850
+ } )
3851
+ . catch ( failTest )
3852
+ . then ( done ) ;
3853
+ } ) ;
3854
+
3836
3855
it ( 'should work for finance traces' , function ( done ) {
3837
3856
var mockOhlc = require ( '@mocks/finance_multicategory.json' ) ;
3838
3857
var mockCopy = Lib . extendDeep ( { } , mockOhlc ) ;
0 commit comments