Skip to content

Commit 3ebb324

Browse files
committed
test: legend scrollbox after relayout
1 parent ce7f8d8 commit 3ebb324

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/jasmine/tests/legend_scroll_test.js

+7
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,14 @@ describe('The legend', function() {
9999
legend = document.getElementsByClassName('legend')[0],
100100
scrollBox,
101101
scrollBar,
102+
scrollBarX,
103+
scrollBarY,
102104
toggle;
103105

104106
legend.dispatchEvent(scrollTo(wheelDeltaY));
107+
scrollBar = legend.getElementsByClassName('scrollbar')[0];
108+
scrollBarX = scrollBar.getAttribute('x'),
109+
scrollBarY = scrollBar.getAttribute('y');
105110

106111
Plotly.relayout(gd, 'showlegend', false);
107112
Plotly.relayout(gd, 'showlegend', true);
@@ -112,6 +117,8 @@ describe('The legend', function() {
112117
toggle = legend.getElementsByClassName('legendtoggle')[0];
113118

114119
legend.dispatchEvent(scrollTo(wheelDeltaY));
120+
expect(scrollBar.getAttribute('x')).toBe(scrollBarX);
121+
expect(scrollBar.getAttribute('y')).toBe(scrollBarY);
115122

116123
var dataScroll = scrollBox.getAttribute('data-scroll');
117124
toggle.dispatchEvent(new MouseEvent('click'));

0 commit comments

Comments
 (0)