Skip to content

Add dragmode: false #3170

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Nov 9, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
add hover test when dragMode = false
‘mousemove’ events should emit ‘plotly_hover’ events
  • Loading branch information
jonfunkhouser committed Nov 6, 2018
commit 174d2b2575fa3e25f94bb878f4cc1c5ec1e53f0b
28 changes: 28 additions & 0 deletions test/jasmine/tests/hover_label_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2785,3 +2785,31 @@ describe('touch devices', function() {
});
});
});

describe('dragmode: false', function() {
var data = [{x: [1, 2, 3], y: [1, 3, 2], type: 'bar'}];
var layout = {width: 600, height: 400, dragmode: false};
var gd;

beforeEach(function(done) {
gd = createGraphDiv();
Plotly.plot(gd, data, layout).then(done);
});
afterEach(destroyGraphDiv);

it('should emit hover events on mousemove', function(done) {
var hoverHandler = jasmine.createSpy('hover');
gd.on('plotly_hover', hoverHandler);
Promise.resolve()
.then(function() {
mouseEvent('mousemove', 105, 300);
mouseEvent('mousemove', 108, 303);
})
.then(delay(HOVERMINTIME * 1.1))
.then(function() {
expect(hoverHandler).toHaveBeenCalled();
})
.catch(failTest)
.then(done);
});
});