Commit b7b47600 by Ben Patterson

Merge pull request #5175 from edx/benp/solano2-jstest-failure

TE-468 JS test: Use the correct array for validating onSeek logs
parents 23531e89 ef383891
......@@ -395,9 +395,21 @@ function (VideoPlayer) {
}, 'currentTime is less than 2 seconds', WAIT_TIMEOUT);
runs(function () {
var args = state.videoPlayer.log.calls[0].args;
// Depending on the browser, the object of arrays may list the
// arrays in a different order. Find the array that is relevent
// to onSeek. Fail if that is not found.
var seekVideoArgIndex
for(var i = 0; i < state.videoPlayer.log.calls.length; i++){
if (state.videoPlayer.log.calls[i].args[0] == 'seek_video') {
seekVideoArgIndex = i
break;
}
}
expect(seekVideoArgIndex).toBeDefined;
var args = state.videoPlayer.log.calls[seekVideoArgIndex].args;
expect(args[0]).toBe('seek_video');
expect(args[1].old_time).toBeLessThan(2);
expect(args[1].new_time).toBe(2);
expect(args[1].type).toBe('onSlideSeek');
......
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