Fixed test for height of player when CC is disabled.

It turned out that we were reading the heights of the contols and other elements
before we initialized the heights.
This commit is contained in:
Valera Rozuvan
2013-08-08 09:43:05 +03:00
parent 326d958727
commit 1f238b953b

View File

@@ -1,5 +1,5 @@
(function() {
xdescribe('VideoCaptionAlpha', function() {
describe('VideoCaptionAlpha', function() {
var state, videoPlayer, videoCaption, videoSpeedControl, oldOTBD;
function initialize() {
@@ -369,14 +369,21 @@
});
it('when CC button is disabled ', function() {
var realHeight = parseInt($('.subtitles').css('maxHeight'), 10),
videoWrapperHeight = $('.video-wrapper').height(),
progressSliderHeight = videoControl.sliderEl.height(),
shouldBeHeight = videoWrapperHeight - 0.5 * progressSliderHeight;
var realHeight, videoWrapperHeight, progressSliderHeight,
controlHeight, shouldBeHeight;
state.captionsHidden = true;
videoCaption.setSubtitlesHeight();
expect(realHeight).toBeCloseTo(shouldBeHeight, 2);
realHeight = parseInt($('.subtitles').css('maxHeight'), 10);
videoWrapperHeight = $('.video-wrapper').height();
progressSliderHeight = videoControl.sliderEl.height();
controlHeight = videoControl.el.height();
shouldBeHeight = videoWrapperHeight -
0.5 * progressSliderHeight -
controlHeight;
expect(realHeight).toBe(shouldBeHeight);
});
});