Add acceptance test instead of broken js unit test.

This commit is contained in:
polesye
2013-10-09 16:53:26 +03:00
parent 7121db0a09
commit e95ee9948b
3 changed files with 31 additions and 38 deletions

View File

@@ -756,44 +756,6 @@
expect(videoCaption.autoScrolling).toBe(true);
});
});
describe('when enter key is pressed on a caption', function () {
var assertCaptions = function (expectations) {
waitsFor(function () {
return videoCaption.captions.length;
}, "Captions are not loaded.", WAIT_TIMEOUT);
runs(expectations);
},
initializeClick = function () {
var e,
subDataLiIdx__0 = $('.subtitles li[data-index=0]');
spyOn(videoCaption, 'seekPlayer').andCallThrough();
videoCaption.isMouseFocus = false;
subDataLiIdx__0.trigger(jQuery.Event('focus'));
e = jQuery.Event('keydown');
e.which = 13; // ENTER key
subDataLiIdx__0.trigger(e);
};
it('shows an outline around it' , function () {
assertCaptions(function() {
var subDataLiIdx__0 = $('.subtitles li[data-index=0]');
initializeClick();
expect(subDataLiIdx__0).toHaveClass('focused');
});
});
it('calls seekPlayer', function () {
assertCaptions(function() {
initializeClick();
expect(videoCaption.seekPlayer).toHaveBeenCalled();
});
});
});
});
});