File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -79,6 +79,21 @@ describe('The legend', function() {
7979 'translate(0, ' + finalDataScroll + ')' ) ;
8080 } ) ;
8181
82+ it ( 'should keep the scrollbar position after a toggle event' , function ( ) {
83+ var scrollBox = legend . getElementsByClassName ( 'scrollbox' ) [ 0 ] ,
84+ toggle = legend . getElementsByClassName ( 'legendtoggle' ) [ 0 ] ,
85+ wheelDeltaY = 100 ;
86+
87+ legend . dispatchEvent ( scrollTo ( wheelDeltaY ) ) ;
88+ var dataScroll = scrollBox . getAttribute ( 'data-scroll' ) ;
89+
90+ toggle . dispatchEvent ( new MouseEvent ( 'click' ) ) ;
91+ expect ( + toggle . parentNode . style . opacity ) . toBeLessThan ( 1 ) ;
92+ expect ( scrollBox . getAttribute ( 'data-scroll' ) ) . toBe ( dataScroll ) ;
93+ expect ( scrollBox . getAttribute ( 'transform' ) ) . toBe (
94+ 'translate(0, ' + dataScroll + ')' ) ;
95+ } ) ;
96+
8297 it ( 'should constrain scrolling to the contents' , function ( ) {
8398 var scrollBox = legend . getElementsByClassName ( 'scrollbox' ) [ 0 ] ;
8499
You can’t perform that action at this time.
0 commit comments