Skip to content

Commit e89769b

Browse files
committed
Modify legend_scroll_test to match bug fix
1 parent d234487 commit e89769b

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

test/jasmine/tests/legend_scroll_test.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,14 +101,15 @@ describe('The legend', function() {
101101
var initialDataScroll = getScroll(gd);
102102
var wheelDeltaY = 100;
103103
var finalDataScroll = Lib.constrain(initialDataScroll +
104-
wheelDeltaY / scrollBarYMax * scrollBoxYMax,
104+
((wheelDeltaY / scrollBoxYMax) * scrollBarYMax),
105105
0, scrollBoxYMax);
106106

107107
legend.dispatchEvent(scrollTo(wheelDeltaY));
108-
109-
expect(getScroll(gd)).toBe(finalDataScroll);
108+
109+
var dataScroll = getScroll(gd);
110+
expect(dataScroll).toBeCloseTo(finalDataScroll, 3);
110111
expect(scrollBox.getAttribute('transform')).toBe(
111-
'translate(0,' + -finalDataScroll + ')');
112+
'translate(0,' + -dataScroll + ')');
112113
});
113114

114115
function dragScroll(element, rightClick, mainClick) {

0 commit comments

Comments
 (0)