* fix: multi lines and spaces issues * fix: eslint operator-linebreak issue * fix: eslint quotes issue * fix: remaining quotes issues * fix: eslint object curly newline issue * fix: eslint object curly spacing issue * fix: eslint brace-style issues * fix: react jsx indent and props issues * fix: eslint trailing spaces issues * fix: eslint linbreak style issue * fix: eslint space unary operator issue * fix: eslint line around directives issue * fix: void and typeof space unary ops issue
44 lines
1.4 KiB
JavaScript
44 lines
1.4 KiB
JavaScript
(function(WAIT_TIMEOUT) {
|
|
'use strict';
|
|
|
|
describe('VideoPoster', function() {
|
|
var state, oldOTBD;
|
|
|
|
beforeEach(function() {
|
|
oldOTBD = window.onTouchBasedDevice;
|
|
window.onTouchBasedDevice = jasmine
|
|
.createSpy('onTouchBasedDevice').and.returnValue(null);
|
|
state = jasmine.initializePlayer('video_with_bumper.html');
|
|
});
|
|
|
|
afterEach(function() {
|
|
$('source').remove();
|
|
state.storage.clear();
|
|
if (state.bumperState && state.bumperState.videoPlayer) {
|
|
state.bumperState.videoPlayer.destroy();
|
|
}
|
|
if (state.videoPlayer) {
|
|
state.videoPlayer.destroy();
|
|
}
|
|
window.onTouchBasedDevice = oldOTBD;
|
|
});
|
|
|
|
it('can render the poster', function() {
|
|
expect($('.poster')).toExist();
|
|
expect($('.btn-play')).toExist();
|
|
});
|
|
|
|
it('can start playing the video on click', function(done) {
|
|
$('.btn-play').click();
|
|
jasmine.waitUntil(function() {
|
|
return state.el.hasClass('is-playing');
|
|
}).done(done);
|
|
});
|
|
|
|
it('destroy itself on "play" event', function() {
|
|
$('.btn-play').click();
|
|
expect($('.poster')).not.toExist();
|
|
});
|
|
});
|
|
}).call(this, window.WAIT_TIMEOUT);
|