From 08ce047fe22a03c0b6267ef35d33838ceb3def65 Mon Sep 17 00:00:00 2001 From: Szczork Date: Tue, 4 Feb 2014 11:52:43 +0100 Subject: [PATCH] add unit test for speed_change_video event --- .../xmodule/js/spec/video/video_player_spec.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/common/lib/xmodule/xmodule/js/spec/video/video_player_spec.js b/common/lib/xmodule/xmodule/js/spec/video/video_player_spec.js index 7c86256e53..086ea7a890 100644 --- a/common/lib/xmodule/xmodule/js/spec/video/video_player_spec.js +++ b/common/lib/xmodule/xmodule/js/spec/video/video_player_spec.js @@ -196,6 +196,17 @@ }); }); + it('speed_change_video event is not logged when speed not change', function () { + expect(state.videoPlayer.log).not.toHaveBeenCalledWith( + 'speed_change_video', + { + current_time: state.videoPlayer.currentTime, + old_speed: state.speed, + new_speed: state.speed + } + ); + }); + it('log the play_video event', function () { expect(state.videoPlayer.log).toHaveBeenCalledWith( 'play_video', { currentTime: 0 }