Skip to content
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
6 changes: 5 additions & 1 deletion test/jasmine/tests/transform_sort_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,14 +273,18 @@ describe('Test sort transform interactions:', function() {
}

function hover(gd, id) {
return new Promise(function(resolve) {
return new Promise(function(resolve, reject) {
gd.once('plotly_hover', function(eventData) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, this pattern is probably the reason we're timing out blind - when we wait for an event to resolve our promise, we need some timeout that causes an explicit error if that event never fires (and gets aborted when the event does fire), so we can see what's happening.

delete gd._lastHoverTime may well solve the issue here, but in case it doesn't (or something else crops up when we alter/extend this later) can you add that?

delete gd._lastHoverTime;
resolve(eventData);
});

var pos = getPxPos(gd, id);
mouseEvent('mousemove', pos[0], pos[1]);

setTimeout(function() {
reject('plotly_hover did not get called!');
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alexcjohnson something like this?

e.g. if we comment out the above mouseEvent() we get:

image

from fail_test.js

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, that's great! Right, and you don't even need to cancel the timeout because after resolve is called, reject doesn't do anything... nice!

In principle to tell precisely what's going on we probably need a message - but that can be added during debugging if we get to that point.

}, 100);
});
}

Expand Down