Commit 4622b24a by Muhammad Ammar Committed by GitHub

Merge pull request #15385 from edx/ammar/fix-video-flaky-test

fix video flaky test
parents b2663002 4d609f80
...@@ -380,22 +380,18 @@ function(VideoPlayer, HLS) { ...@@ -380,22 +380,18 @@ function(VideoPlayer, HLS) {
}); });
describe('when the video is playing', function() { describe('when the video is playing', function() {
beforeEach(function(done) { it('call runTimer in seekTo on player', function(done) {
state.videoPlayer.play(); state.videoPlayer.play();
jasmine.waitUntil(function() { jasmine.waitUntil(function() {
return state.videoPlayer.isPlaying(); return state.videoPlayer.isPlaying();
}).done(done); }).then(function() {
}); spyOn(state.videoPlayer, 'stopTimer').and.callThrough();
spyOn(state.videoPlayer, 'runTimer').and.callThrough();
state.videoPlayer.seekTo(10);
it('call runTimer in seekTo on player', function() { expect(state.videoPlayer.currentTime).toBe(10);
spyOn(state.videoPlayer, 'stopTimer').and.callThrough(); expect(state.videoPlayer.stopTimer).toHaveBeenCalled();
spyOn(state.videoPlayer, 'runTimer').and.callThrough(); expect(state.videoPlayer.runTimer).toHaveBeenCalled();
state.videoPlayer.seekTo(10); }).always(done);
expect(state.videoPlayer.currentTime).toBe(10);
expect(state.videoPlayer.stopTimer).toHaveBeenCalled();
expect(state.videoPlayer.runTimer).toHaveBeenCalled();
}); });
it('seek the player', function() { it('seek the player', function() {
......
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