Commit 3c9d86f7 by Will Daly

Add explicit wait to JS transcript tests

parent 5449a3cc
......@@ -168,6 +168,8 @@ function ($, Backbone, _, Utils, Editor, MetadataView, MetadataModel, MetadataCo
return (displayNameValue !== "" && displayNameValue != "video_id");
}, "Defaults never loaded", 1000);
runs(function() {
var displayNameValue = collection[0].getValue();
var videoUrlValue = collection[1].getValue();
......@@ -178,6 +180,7 @@ function ($, Backbone, _, Utils, Editor, MetadataView, MetadataModel, MetadataCo
'default.webm'
]);
});
});
it('If metadataCollection is not defined', function () {
transcripts.syncBasicTab(null);
......@@ -220,11 +223,19 @@ function ($, Backbone, _, Utils, Editor, MetadataView, MetadataModel, MetadataCo
it('Correct data', function () {
transcripts.syncAdvancedTab(metadataCollection);
var collection = metadataCollection.models,
displayNameValue = collection[0].getValue(),
subValue = collection[1].getValue(),
html5SourcesValue = collection[2].getValue(),
youtubeValue = collection[3].getValue();
var collection = metadataCollection.models;
waitsFor(function() {
var displayNameValue = collection[0].getValue();
return (displayNameValue !== "" && displayNameValue != "video_id");
}, "Defaults never loaded", 1000);
runs(function() {
var displayNameValue = collection[0].getValue();
var subValue = collection[1].getValue();
var html5SourcesValue = collection[2].getValue();
var youtubeValue = collection[3].getValue();
expect(displayNameValue).toBe('display value');
expect(subValue).toBe('default');
......@@ -234,6 +245,7 @@ function ($, Backbone, _, Utils, Editor, MetadataView, MetadataModel, MetadataCo
]);
expect(youtubeValue).toBe('12345678901');
});
});
it('metadataCollection is not defined', function () {
transcripts.syncAdvancedTab(null);
......
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