Commit 8fef4148 by Usman Khalid

Re-enabled videolist_spec, message_manager_spec and file_uploader_spec.

parent 68e24140
...@@ -231,9 +231,9 @@ testFiles = [ ...@@ -231,9 +231,9 @@ testFiles = [
"coffee/spec/views/upload_spec", "coffee/spec/views/upload_spec",
"js/spec/video/transcripts/utils_spec", "js/spec/video/transcripts/utils_spec",
"js/spec/video/transcripts/editor_spec", "js/spec/video/transcripts/editor_spec",
# "js/spec/video/transcripts/videolist_spec", "js/spec/video/transcripts/videolist_spec",
# "js/spec/video/transcripts/message_manager_spec", "js/spec/video/transcripts/message_manager_spec",
# "js/spec/video/transcripts/file_uploader_spec", "js/spec/video/transcripts/file_uploader_spec",
"js/spec/models/component_template_spec", "js/spec/models/component_template_spec",
"js/spec/models/explicit_url_spec", "js/spec/models/explicit_url_spec",
"js/spec/models/xblock_info_spec", "js/spec/models/xblock_info_spec",
......
...@@ -5,8 +5,9 @@ define( ...@@ -5,8 +5,9 @@ define(
"xmodule", "jquery.form" "xmodule", "jquery.form"
], ],
function ($, _, Utils, FileUploader) { function ($, _, Utils, FileUploader) {
// TODO: fix TNL-559 Intermittent failures of Transcript FileUploader JS tests 'use strict';
xdescribe('Transcripts.FileUploader', function () {
describe('Transcripts.FileUploader', function () {
var videoListEntryTemplate = readFixtures( var videoListEntryTemplate = readFixtures(
'video/transcripts/metadata-videolist-entry.underscore' 'video/transcripts/metadata-videolist-entry.underscore'
), ),
...@@ -67,10 +68,9 @@ function ($, _, Utils, FileUploader) { ...@@ -67,10 +68,9 @@ function ($, _, Utils, FileUploader) {
it('Template doesn\'t exist', function () { it('Template doesn\'t exist', function () {
spyOn(console, 'error'); spyOn(console, 'error');
view.uploadTpl = ''; view.uploadTpl = '';
view.render();
expect(console.error).toHaveBeenCalled();
expect(view.render).not.toThrow(); expect(view.render).not.toThrow();
expect(console.error).toHaveBeenCalled();
expect(_.template).not.toHaveBeenCalled(); expect(_.template).not.toHaveBeenCalled();
}); });
...@@ -78,8 +78,6 @@ function ($, _, Utils, FileUploader) { ...@@ -78,8 +78,6 @@ function ($, _, Utils, FileUploader) {
function () { function () {
$('.transcripts-file-uploader').remove(); $('.transcripts-file-uploader').remove();
view.render();
expect(view.render).not.toThrow(); expect(view.render).not.toThrow();
expect(_.template).not.toHaveBeenCalled(); expect(_.template).not.toHaveBeenCalled();
} }
...@@ -93,8 +91,6 @@ function ($, _, Utils, FileUploader) { ...@@ -93,8 +91,6 @@ function ($, _, Utils, FileUploader) {
}).join(', '); }).join(', ');
view.validFileExtensions = validFileExtensions; view.validFileExtensions = validFileExtensions;
view.render();
expect(view.render).not.toThrow(); expect(view.render).not.toThrow();
expect(_.template).toHaveBeenCalled(); expect(_.template).toHaveBeenCalled();
$.each(elList, function(index, el) { $.each(elList, function(index, el) {
......
...@@ -6,9 +6,9 @@ define( ...@@ -6,9 +6,9 @@ define(
"xmodule" "xmodule"
], ],
function ($, _, Utils, MessageManager, FileUploader, sinon) { function ($, _, Utils, MessageManager, FileUploader, sinon) {
'use strict';
// TODO: fix TNL-559 Intermittent failures of Transcript FileUploader JS tests describe('Transcripts.MessageManager', function () {
xdescribe('Transcripts.MessageManager', function () {
var videoListEntryTemplate = readFixtures( var videoListEntryTemplate = readFixtures(
'video/transcripts/metadata-videolist-entry.underscore' 'video/transcripts/metadata-videolist-entry.underscore'
), ),
...@@ -46,7 +46,7 @@ function ($, _, Utils, MessageManager, FileUploader, sinon) { ...@@ -46,7 +46,7 @@ function ($, _, Utils, MessageManager, FileUploader, sinon) {
); );
$container = $('#metadata-videolist-entry'); $container = $('#metadata-videolist-entry');
spyOn(fileUploader, 'initialize'); spyOn(fileUploader, 'initialize').and.callThrough();
spyOn(console, 'error'); spyOn(console, 'error');
spyOn(Utils.Storage, 'set'); spyOn(Utils.Storage, 'set');
...@@ -66,12 +66,11 @@ function ($, _, Utils, MessageManager, FileUploader, sinon) { ...@@ -66,12 +66,11 @@ function ($, _, Utils, MessageManager, FileUploader, sinon) {
}); });
}); });
// Disabled 2/6/14 after intermittent failure in master
describe('Render', function () { describe('Render', function () {
beforeEach(function () { beforeEach(function () {
spyOn(_,'template').and.callThrough(); spyOn(_,'template').and.callThrough();
spyOn(fileUploader, 'render'); spyOn(view.fileUploader, 'render');
}); });
it('Template doesn\'t exist', function () { it('Template doesn\'t exist', function () {
...@@ -81,7 +80,7 @@ function ($, _, Utils, MessageManager, FileUploader, sinon) { ...@@ -81,7 +80,7 @@ function ($, _, Utils, MessageManager, FileUploader, sinon) {
expect(_.template).not.toHaveBeenCalled(); expect(_.template).not.toHaveBeenCalled();
expect(view.$el.find('.transcripts-status')) expect(view.$el.find('.transcripts-status'))
.toHaveClass('is-invisible'); .toHaveClass('is-invisible');
expect(fileUploader.render).not.toHaveBeenCalled(); expect(view.fileUploader.render).not.toHaveBeenCalled();
}); });
it('All works okay if correct data is passed', function () { it('All works okay if correct data is passed', function () {
...@@ -90,7 +89,7 @@ function ($, _, Utils, MessageManager, FileUploader, sinon) { ...@@ -90,7 +89,7 @@ function ($, _, Utils, MessageManager, FileUploader, sinon) {
expect(console.error).not.toHaveBeenCalled(); expect(console.error).not.toHaveBeenCalled();
expect(_.template).toHaveBeenCalled(); expect(_.template).toHaveBeenCalled();
expect(view.$el).not.toHaveClass('is-invisible'); expect(view.$el).not.toHaveClass('is-invisible');
expect(fileUploader.render).toHaveBeenCalled(); expect(view.fileUploader.render).toHaveBeenCalled();
}); });
}); });
......
...@@ -19,7 +19,8 @@ function($, Backbone, _, Utils) { ...@@ -19,7 +19,8 @@ function($, Backbone, _, Utils) {
initialize: function (options) { initialize: function (options) {
_.bindAll(this, _.bindAll(this,
'changeHandler', 'clickHandler', 'xhrResetProgressBar', 'xhrProgressHandler', 'xhrCompleteHandler' 'changeHandler', 'clickHandler', 'xhrResetProgressBar', 'xhrProgressHandler', 'xhrCompleteHandler',
'render'
); );
this.options = _.extend({}, options); this.options = _.extend({}, options);
this.file = false; this.file = false;
......
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