Skip to content

Commit 5a127f0

Browse files
committed
revert changes made to one test in legend_scroll
1 parent 33b72e1 commit 5a127f0

File tree

1 file changed

+23
-28
lines changed

1 file changed

+23
-28
lines changed

test/jasmine/tests/legend_scroll_test.js

+23-28
Original file line numberDiff line numberDiff line change
@@ -323,34 +323,29 @@ describe('The legend', function() {
323323
scrollBarX = scrollBar.getAttribute('x'),
324324
scrollBarY = scrollBar.getAttribute('y');
325325

326-
Plotly.relayout(gd, 'showlegend', false)
327-
.then(function() {
328-
Plotly.relayout(gd, 'showlegend', true);
329-
})
330-
.then(function() {
331-
legend = getLegend();
332-
scrollBox = getScrollBox();
333-
scrollBar = getScrollBar();
334-
toggle = getToggle();
335-
336-
legend.dispatchEvent(scrollTo(wheelDeltaY));
337-
expect(scrollBar.getAttribute('x')).toBe(scrollBarX);
338-
expect(scrollBar.getAttribute('y')).toBe(scrollBarY);
339-
340-
var dataScroll = getScroll(gd);
341-
toggle.dispatchEvent(new MouseEvent('mousedown'));
342-
toggle.dispatchEvent(new MouseEvent('mouseup'));
343-
setTimeout(function() {
344-
expect(+toggle.parentNode.style.opacity).toBeLessThan(1);
345-
expect(getScroll(gd)).toBe(dataScroll);
346-
expect(scrollBox.getAttribute('transform')).toBe(
347-
'translate(0,' + -dataScroll + ')');
348-
expect(scrollBar.getAttribute('width')).toBeGreaterThan(0);
349-
expect(scrollBar.getAttribute('height')).toBeGreaterThan(0);
350-
}, DBLCLICKDELAY * 2);
351-
})
352-
.catch(failTest)
353-
.then(done);
326+
Plotly.relayout(gd, 'showlegend', false);
327+
Plotly.relayout(gd, 'showlegend', true);
328+
legend = getLegend();
329+
scrollBox = getScrollBox();
330+
scrollBar = getScrollBar();
331+
toggle = getToggle();
332+
333+
legend.dispatchEvent(scrollTo(wheelDeltaY));
334+
expect(scrollBar.getAttribute('x')).toBe(scrollBarX);
335+
expect(scrollBar.getAttribute('y')).toBe(scrollBarY);
336+
337+
var dataScroll = getScroll(gd);
338+
toggle.dispatchEvent(new MouseEvent('mousedown'));
339+
toggle.dispatchEvent(new MouseEvent('mouseup'));
340+
setTimeout(function() {
341+
expect(+toggle.parentNode.style.opacity).toBeLessThan(1);
342+
expect(getScroll(gd)).toBe(dataScroll);
343+
expect(scrollBox.getAttribute('transform')).toBe(
344+
'translate(0,' + -dataScroll + ')');
345+
expect(scrollBar.getAttribute('width')).toBeGreaterThan(0);
346+
expect(scrollBar.getAttribute('height')).toBeGreaterThan(0);
347+
done();
348+
}, DBLCLICKDELAY * 2);
354349
});
355350

356351
it('should constrain scrolling to the contents', function() {

0 commit comments

Comments
 (0)