File tree 1 file changed +7
-0
lines changed
1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -99,9 +99,14 @@ describe('The legend', function() {
99
99
legend = document . getElementsByClassName ( 'legend' ) [ 0 ] ,
100
100
scrollBox ,
101
101
scrollBar ,
102
+ scrollBarX ,
103
+ scrollBarY ,
102
104
toggle ;
103
105
104
106
legend . dispatchEvent ( scrollTo ( wheelDeltaY ) ) ;
107
+ scrollBar = legend . getElementsByClassName ( 'scrollbar' ) [ 0 ] ;
108
+ scrollBarX = scrollBar . getAttribute ( 'x' ) ,
109
+ scrollBarY = scrollBar . getAttribute ( 'y' ) ;
105
110
106
111
Plotly . relayout ( gd , 'showlegend' , false ) ;
107
112
Plotly . relayout ( gd , 'showlegend' , true ) ;
@@ -112,6 +117,8 @@ describe('The legend', function() {
112
117
toggle = legend . getElementsByClassName ( 'legendtoggle' ) [ 0 ] ;
113
118
114
119
legend . dispatchEvent ( scrollTo ( wheelDeltaY ) ) ;
120
+ expect ( scrollBar . getAttribute ( 'x' ) ) . toBe ( scrollBarX ) ;
121
+ expect ( scrollBar . getAttribute ( 'y' ) ) . toBe ( scrollBarY ) ;
115
122
116
123
var dataScroll = scrollBox . getAttribute ( 'data-scroll' ) ;
117
124
toggle . dispatchEvent ( new MouseEvent ( 'click' ) ) ;
You can’t perform that action at this time.
0 commit comments