-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Properly check if the slider values have changed #879
Conversation
Good catch! |
test/specs/KeyboardSupportSpec.js
Outdated
// FIXME: Setup async event dispatch | ||
// $handle1[0].dispatchEvent(keyboardEvent); | ||
mySlider.handle1Keydown(keyboardEvent); | ||
expect(hasSlideStarted).toBe(true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so this may not work the way you expect it to since the callbacks within the event listeners may not be invoked until the next tick of the event loop.
I would write this test in an async manner using the done
callback and just do the assertions within the slideStop
event listener and invoke done()
on completion
test/specs/KeyboardSupportSpec.js
Outdated
var hasSlideStopped = false; | ||
options.value = [-100, 0]; | ||
mySlider = new Slider($('#testSlider1')[0], options); | ||
// $handle1 = $('#mySlider').find('.slider-handle:first'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove commented code
test/specs/KeyboardSupportSpec.js
Outdated
var mySlider; | ||
var keyboardEvent; | ||
var options; | ||
// var $handle1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove commented code
7a9ba10
to
97fbd5f
Compare
Fixes #878
I'll add unit tests later.
You can check the JSFiddle in the issue.
Pull Requests
Please accompany all pull requests with the following (where appropriate):
grunt test
in your Terminal within the bootstrap-slider repository directory