Commit 2cc9679e by jmclaus

Used Jasmine jQuery for tests instead

parent ffa49b03
...@@ -140,24 +140,22 @@ ...@@ -140,24 +140,22 @@
}); });
describe('make sure the speed control gets the focus afterwards', function() { describe('make sure the speed control gets the focus afterwards', function() {
var focusSpy; var spyEvent;
beforeEach(function() { beforeEach(function() {
initialize(); initialize();
videoSpeedControl.setSpeed(1.0); videoSpeedControl.setSpeed(1.0);
focusSpy = spyOn($.fn, 'focus').andCallThrough(); spyEvent = spyOnEvent('.speeds > a', 'focus');
}); });
it('when the speed is the same', function() { it('when the speed is the same', function() {
$('li[data-speed="1.0"] a').click(); $('li[data-speed="1.0"] a').click();
expect(focusSpy).toHaveBeenCalled(); expect(spyEvent).toHaveBeenTriggered();
expect(focusSpy.mostRecentCall.object.selector).toEqual('.parent().parent().siblings(a)');
}); });
it('when the speed is not the same', function() { it('when the speed is not the same', function() {
$('li[data-speed="0.75"] a').click(); $('li[data-speed="0.75"] a').click();
expect(focusSpy).toHaveBeenCalled(); expect(spyEvent).toHaveBeenTriggered();;
expect(focusSpy.mostRecentCall.object.selector).toEqual('.parent().parent().siblings(a)');
}); });
}); });
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment