Commit feb95eb8 by jmclaus

Fixed tests

parent 2cc9679e
...@@ -140,22 +140,20 @@ ...@@ -140,22 +140,20 @@
}); });
describe('make sure the speed control gets the focus afterwards', function() { describe('make sure the speed control gets the focus afterwards', function() {
var spyEvent; beforeEach(function() {
beforeEach(function() {
initialize(); initialize();
videoSpeedControl.setSpeed(1.0); videoSpeedControl.setSpeed(1.0);
spyEvent = spyOnEvent('.speeds > a', 'focus'); spyOnEvent(state.videoSpeedControl.mainAnchor, '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(spyEvent).toHaveBeenTriggered(); expect('focus').toHaveBeenTriggeredOn(state.videoSpeedControl.mainAnchor);
}); });
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(spyEvent).toHaveBeenTriggered();; expect('focus').toHaveBeenTriggeredOn(state.videoSpeedControl.mainAnchor);
}); });
}); });
}); });
......
...@@ -62,6 +62,8 @@ function () { ...@@ -62,6 +62,8 @@ function () {
state.videoSpeedControl.el = state.el.find('div.speeds'); state.videoSpeedControl.el = state.el.find('div.speeds');
state.videoSpeedControl.mainAnchor = state.videoSpeedControl.el.children('a');
state.videoSpeedControl.videoSpeedsEl = state.videoSpeedControl.el state.videoSpeedControl.videoSpeedsEl = state.videoSpeedControl.el
.find('.video_speeds'); .find('.video_speeds');
......
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