You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
893 B
33 lines
893 B
//-------------------------------------------------- |
|
//-------------------------------------------------- |
|
//-- Removes attached function from slider event -- |
|
//-------------------------------------------------- |
|
//-------------------------------------------------- |
|
|
|
|
|
|
|
describe("'off()' test", function() { |
|
var testSlider, eventHandlerTriggered, mouse; |
|
|
|
var onStart = function(){ |
|
eventHandlerTriggered = true; |
|
}; |
|
|
|
|
|
beforeEach(function() { |
|
eventHandlerTriggered = false; |
|
mouse = document.createEvent('MouseEvents'); |
|
}); |
|
|
|
|
|
it("should properly unbind an event listener", function() { |
|
testSlider = $("#testSlider1").slider(); |
|
|
|
testSlider.on('slideStart', onStart); |
|
testSlider.off('slideStart', onStart); |
|
|
|
testSlider.data('slider')._mousedown(mouse); |
|
|
|
expect(eventHandlerTriggered).not.toBeTruthy(); |
|
}); |
|
}); |