Fixed tests

This commit is contained in:
jmclaus
2013-09-24 10:30:45 +02:00
parent 2cc9679ea8
commit feb95eb869
2 changed files with 6 additions and 6 deletions

View File

@@ -140,22 +140,20 @@
});
describe('make sure the speed control gets the focus afterwards', function() {
var spyEvent;
beforeEach(function() {
beforeEach(function() {
initialize();
videoSpeedControl.setSpeed(1.0);
spyEvent = spyOnEvent('.speeds > a', 'focus');
spyOnEvent(state.videoSpeedControl.mainAnchor, 'focus');
});
it('when the speed is the same', function() {
$('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() {
$('li[data-speed="0.75"] a').click();
expect(spyEvent).toHaveBeenTriggered();;
expect('focus').toHaveBeenTriggeredOn(state.videoSpeedControl.mainAnchor);
});
});
});

View File

@@ -62,6 +62,8 @@ function () {
state.videoSpeedControl.el = state.el.find('div.speeds');
state.videoSpeedControl.mainAnchor = state.videoSpeedControl.el.children('a');
state.videoSpeedControl.videoSpeedsEl = state.videoSpeedControl.el
.find('.video_speeds');