From feb95eb86965f573e3e4a9c6814e4706b8306532 Mon Sep 17 00:00:00 2001 From: jmclaus Date: Tue, 24 Sep 2013 10:30:45 +0200 Subject: [PATCH] Fixed tests --- .../xmodule/js/spec/video/video_speed_control_spec.js | 10 ++++------ .../xmodule/js/src/video/08_video_speed_control.js | 2 ++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/common/lib/xmodule/xmodule/js/spec/video/video_speed_control_spec.js b/common/lib/xmodule/xmodule/js/spec/video/video_speed_control_spec.js index a4369005cc..13a5705238 100644 --- a/common/lib/xmodule/xmodule/js/spec/video/video_speed_control_spec.js +++ b/common/lib/xmodule/xmodule/js/spec/video/video_speed_control_spec.js @@ -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); }); }); }); diff --git a/common/lib/xmodule/xmodule/js/src/video/08_video_speed_control.js b/common/lib/xmodule/xmodule/js/src/video/08_video_speed_control.js index 67f62edf95..2ba8a30144 100644 --- a/common/lib/xmodule/xmodule/js/src/video/08_video_speed_control.js +++ b/common/lib/xmodule/xmodule/js/src/video/08_video_speed_control.js @@ -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');