Skip to content
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

makes event listener callbacks execute asynchronously #902

Merged
merged 5 commits into from
Jan 6, 2019
Merged
Show file tree
Hide file tree
Changes from 3 commits
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
11 changes: 3 additions & 8 deletions test/specs/DraggingHandlesSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,28 +221,23 @@ describe("Dragging handles tests", function() {
expect(testSlider.getValue()).toEqual([2, 5]);
});

it("Should trigger change on mouseup", function() {
var ups = 0;
it("Should trigger change on mouseup", function(done) {
jespirit marked this conversation as resolved.
Show resolved Hide resolved
var changes = 0;

testSlider.on('slideStop', function(){
expect(changes).toBe(1);
ups++;
expect(testSlider.getValue()).toEqual([2, 5]);
done();
});

testSlider.mousedown(mouseEvent('mousedown', tickOffsets[1]));
expect(testSlider.getValue()).toEqual([1, 5]);
expect(ups).toBe(0);

testSlider.on('change', function(){
expect(ups).toBe(0);
changes++;
});

testSlider.mouseup(mouseEvent('mouseup', tickOffsets[2]));
expect(testSlider.getValue()).toEqual([2, 5]);
expect(changes).toBe(1);
expect(ups).toBe(1);
});

describe("Test 'mousemove' and 'mouseup' produces correct results", function() {
Expand Down
Loading