diff --git a/common/lib/xmodule/xmodule/js/spec/videoalpha/general_spec.js b/common/lib/xmodule/xmodule/js/spec/videoalpha/general_spec.js index c263c5f248..dab066b91e 100644 --- a/common/lib/xmodule/xmodule/js/spec/videoalpha/general_spec.js +++ b/common/lib/xmodule/xmodule/js/spec/videoalpha/general_spec.js @@ -1,5 +1,5 @@ (function () { - xdescribe('VideoAlpha', function () { + describe('VideoAlpha', function () { beforeEach(function () { jasmine.stubRequests(); window.onTouchBasedDevice = jasmine.createSpy('onTouchBasedDevice').andReturn(false); @@ -12,6 +12,7 @@ window.OldVideoPlayerAlpha = undefined; window.onYouTubePlayerAPIReady = undefined; window.onHTML5PlayerAPIReady = undefined; + $('source').remove(); }); describe('constructor', function () { diff --git a/common/lib/xmodule/xmodule/js/spec/videoalpha/html5_video_spec.js b/common/lib/xmodule/xmodule/js/spec/videoalpha/html5_video_spec.js index 881c78d6fa..62c8844e5e 100644 --- a/common/lib/xmodule/xmodule/js/spec/videoalpha/html5_video_spec.js +++ b/common/lib/xmodule/xmodule/js/spec/videoalpha/html5_video_spec.js @@ -1,5 +1,5 @@ (function () { - xdescribe('VideoAlpha HTML5Video', function () { + describe('VideoAlpha HTML5Video', function () { var state, player, playbackRates = [0.75, 1.0, 1.25, 1.5]; function initialize() { @@ -13,6 +13,13 @@ player.config.events.onReady = jasmine.createSpy('onReady'); }); + afterEach(function() { + YT.Player = void 0; + $.fn.scrollTo.reset(); + $('.subtitles').remove(); + $('source').remove(); + }); + describe('events:', function () { beforeEach(function () { spyOn(player, 'callStateChangeCallback').andCallThrough(); diff --git a/common/lib/xmodule/xmodule/js/spec/videoalpha/video_caption_spec.js b/common/lib/xmodule/xmodule/js/spec/videoalpha/video_caption_spec.js index 206d29ff6c..fd94979d89 100644 --- a/common/lib/xmodule/xmodule/js/spec/videoalpha/video_caption_spec.js +++ b/common/lib/xmodule/xmodule/js/spec/videoalpha/video_caption_spec.js @@ -1,5 +1,5 @@ (function() { - xdescribe('VideoCaptionAlpha', function() { + describe('VideoCaptionAlpha', function() { var state, videoPlayer, videoCaption, videoSpeedControl; function initialize() { @@ -11,14 +11,15 @@ } beforeEach(function() { - initialize(); window.onTouchBasedDevice = jasmine.createSpy('onTouchBasedDevice').andReturn(false); + initialize(); }); afterEach(function() { YT.Player = void 0; $.fn.scrollTo.reset(); $('.subtitles').remove(); + $('source').remove(); }); describe('constructor', function() { @@ -117,7 +118,7 @@ describe('mouse movement', function() { beforeEach(function() { - initialize(); + //initialize(); window.setTimeout.andReturn(100); spyOn(window, 'clearTimeout'); }); @@ -209,7 +210,7 @@ describe('search', function() { beforeEach(function() { - initialize(); + //initialize(); }); it('return a correct caption index', function() { @@ -264,7 +265,7 @@ describe('pause', function() { beforeEach(function() { - initialize(); + //initialize(); videoCaption.playing = true; videoCaption.pause(); }); @@ -275,9 +276,9 @@ }); describe('updatePlayTime', function() { - beforeEach(function() { + /*beforeEach(function() { initialize(); - }); + });*/ describe('when the video speed is 1.0x', function() { beforeEach(function() { @@ -421,7 +422,7 @@ describe('seekPlayer', function() { describe('when the video speed is 1.0x', function() { beforeEach(function() { - initialize(); + //initialize(); videoSpeedControl.currentSpeed = '1.0'; $('.subtitles li[data-start="14910"]').trigger('click'); }); diff --git a/common/lib/xmodule/xmodule/js/spec/videoalpha/video_control_spec.js b/common/lib/xmodule/xmodule/js/spec/videoalpha/video_control_spec.js index 875b1e19dd..a3c98320a8 100644 --- a/common/lib/xmodule/xmodule/js/spec/videoalpha/video_control_spec.js +++ b/common/lib/xmodule/xmodule/js/spec/videoalpha/video_control_spec.js @@ -1,5 +1,5 @@ (function() { - xdescribe('VideoControlAlpha', function() { + describe('VideoControlAlpha', function() { var state, videoControl; function initialize() { @@ -8,6 +8,10 @@ videoControl = state.videoControl; } + afterEach(function() { + $('source').remove(); + }); + describe('constructor', function() { beforeEach(function() { window.onTouchBasedDevice = jasmine.createSpy('onTouchBasedDevice').andReturn(false); @@ -42,6 +46,10 @@ initialize(); }); + afterEach(function(){ + window.onTouchBasedDevice.andReturn(false); + }); + it('does not add the play class to video control', function() { expect($('.video_control')).not.toHaveClass('play'); expect($('.video_control')).not.toHaveAttr('title', 'Play'); diff --git a/common/lib/xmodule/xmodule/js/spec/videoalpha/video_player_spec.js b/common/lib/xmodule/xmodule/js/spec/videoalpha/video_player_spec.js index 030de1ee8e..b0f24ba09a 100644 --- a/common/lib/xmodule/xmodule/js/spec/videoalpha/video_player_spec.js +++ b/common/lib/xmodule/xmodule/js/spec/videoalpha/video_player_spec.js @@ -1,5 +1,5 @@ (function() { - xdescribe('VideoPlayerAlpha', function() { + describe('VideoPlayerAlpha', function() { var state, videoPlayer, player, videoControl, videoCaption, videoProgressSlider, videoSpeedControl, videoVolumeControl; function initialize(fixture) { @@ -23,6 +23,10 @@ initialize('videoalpha.html'); } + afterEach(function() { + $('source').remove(); + }); + describe('constructor', function() { beforeEach(function() { $.fn.qtip.andCallFake(function() { @@ -64,6 +68,7 @@ it('create video progress slider', function() { expect(videoProgressSlider).toBeDefined(); + console.log('videoProgressSlider', videoProgressSlider, state, state.videoControl.sliderEl) expect(videoProgressSlider.el).toHaveClass('slider'); }); @@ -754,7 +759,7 @@ it('set the player volume', function() { player.setVolume(60); - expect(player.getVolume()).toEqual(0.6); + expect(Number(player.getVolume().toFixed(1)).toEqual(0.6); }); }); }); diff --git a/common/lib/xmodule/xmodule/js/spec/videoalpha/video_progress_slider_spec.js b/common/lib/xmodule/xmodule/js/spec/videoalpha/video_progress_slider_spec.js index 1bc852e2b8..db1a8a2ad9 100644 --- a/common/lib/xmodule/xmodule/js/spec/videoalpha/video_progress_slider_spec.js +++ b/common/lib/xmodule/xmodule/js/spec/videoalpha/video_progress_slider_spec.js @@ -1,5 +1,5 @@ (function() { - xdescribe('VideoProgressSliderAlpha', function() { + describe('VideoProgressSliderAlpha', function() { var state, videoPlayer, videoProgressSlider; function initialize() { @@ -13,6 +13,11 @@ window.onTouchBasedDevice = jasmine.createSpy('onTouchBasedDevice').andReturn(false); }); + + afterEach(function() { + $('source').remove(); + }); + describe('constructor', function() { describe('on a non-touch based device', function() { beforeEach(function() { diff --git a/common/lib/xmodule/xmodule/js/spec/videoalpha/video_quality_control_spec.js b/common/lib/xmodule/xmodule/js/spec/videoalpha/video_quality_control_spec.js index 68df2baad6..9bc535b2f0 100644 --- a/common/lib/xmodule/xmodule/js/spec/videoalpha/video_quality_control_spec.js +++ b/common/lib/xmodule/xmodule/js/spec/videoalpha/video_quality_control_spec.js @@ -1,5 +1,5 @@ (function() { - xdescribe('VideoQualityControlAlpha', function() { + describe('VideoQualityControlAlpha', function() { var state, videoControl, videoQualityControl; function initialize() { @@ -9,6 +9,11 @@ videoQualityControl = state.videoQualityControl; } + + afterEach(function() { + $('source').remove(); + }); + describe('constructor', function() { beforeEach(function() { initialize(); diff --git a/common/lib/xmodule/xmodule/js/spec/videoalpha/video_speed_control_spec.js b/common/lib/xmodule/xmodule/js/spec/videoalpha/video_speed_control_spec.js index 746c42a864..71b89419c1 100644 --- a/common/lib/xmodule/xmodule/js/spec/videoalpha/video_speed_control_spec.js +++ b/common/lib/xmodule/xmodule/js/spec/videoalpha/video_speed_control_spec.js @@ -1,5 +1,5 @@ (function() { - xdescribe('VideoSpeedControlAlpha', function() { + describe('VideoSpeedControlAlpha', function() { var state, videoPlayer, videoControl, videoSpeedControl; function initialize() { @@ -14,6 +14,11 @@ window.onTouchBasedDevice = jasmine.createSpy('onTouchBasedDevice').andReturn(false); }); + + afterEach(function() { + $('source').remove(); + }); + describe('constructor', function() { describe('always', function() { beforeEach(function() { diff --git a/common/lib/xmodule/xmodule/js/spec/videoalpha/video_volume_control_spec.js b/common/lib/xmodule/xmodule/js/spec/videoalpha/video_volume_control_spec.js index 7e0059f07c..0d6adef58d 100644 --- a/common/lib/xmodule/xmodule/js/spec/videoalpha/video_volume_control_spec.js +++ b/common/lib/xmodule/xmodule/js/spec/videoalpha/video_volume_control_spec.js @@ -1,5 +1,5 @@ (function() { - xdescribe('VideoVolumeControlAlpha', function() { + describe('VideoVolumeControlAlpha', function() { var state, videoControl, videoVolumeControl; function initialize() { @@ -9,6 +9,12 @@ videoVolumeControl = state.videoVolumeControl; } + + + afterEach(function() { + $('source').remove(); + }); + describe('constructor', function() { beforeEach(function() { spyOn($.fn, 'slider').andCallThrough(); diff --git a/common/lib/xmodule/xmodule/js/src/videoalpha/10_video_caption.js b/common/lib/xmodule/xmodule/js/src/videoalpha/10_video_caption.js index a23d500297..e44219bb79 100644 --- a/common/lib/xmodule/xmodule/js/src/videoalpha/10_video_caption.js +++ b/common/lib/xmodule/xmodule/js/src/videoalpha/10_video_caption.js @@ -125,7 +125,8 @@ function () { } else { _this.videoCaption.renderCaption(); } - }); + }) + .error(function(){console.error('Subtitles not found. Upload subtitles to server!');}); } function captionURL() {