Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
bf9e525e
Commit
bf9e525e
authored
Nov 08, 2013
by
Valera Rozuvan
Committed by
polesye
Nov 12, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BLD-489: Fix JavaScript tests.
parent
336d648e
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
15 deletions
+16
-15
cms/static/js/views/transcripts/message_manager.js
+1
-1
cms/static/js/views/transcripts/metadata_videolist.js
+3
-1
cms/static/js_spec/transcripts/editor_spec.js
+12
-13
cms/static/js_spec/transcripts/videolist_spec.js
+0
-0
No files found.
cms/static/js/views/transcripts/message_manager.js
View file @
bf9e525e
...
@@ -68,7 +68,7 @@ function($, Backbone, _, Utils, FileUploader, gettext) {
...
@@ -68,7 +68,7 @@ function($, Backbone, _, Utils, FileUploader, gettext) {
if
(
!
tplHtml
)
{
if
(
!
tplHtml
)
{
console
.
error
(
'Couldn
\'
t load Transcripts status template'
);
console
.
error
(
'Couldn
\'
t load Transcripts status template'
);
return
;
return
this
;
}
}
template
=
_
.
template
(
tplHtml
);
template
=
_
.
template
(
tplHtml
);
...
...
cms/static/js/views/transcripts/metadata_videolist.js
View file @
bf9e525e
...
@@ -28,7 +28,9 @@ function($, Backbone, _, AbstractEditor, Utils, MessageManager, MetadataView) {
...
@@ -28,7 +28,9 @@ function($, Backbone, _, AbstractEditor, Utils, MessageManager, MetadataView) {
// Initialize MessageManager that is responsible for
// Initialize MessageManager that is responsible for
// status messages and errors.
// status messages and errors.
this
.
messenger
=
new
MessageManager
({
var
messenger
=
this
.
options
.
MessageManager
||
MessageManager
;
this
.
messenger
=
new
messenger
({
el
:
this
.
$el
,
el
:
this
.
$el
,
parent
:
this
parent
:
this
});
});
...
...
cms/static/js_spec/transcripts/editor_spec.js
View file @
bf9e525e
...
@@ -169,11 +169,10 @@ function ($, Backbone, _, Utils, Editor, MetadataView, MetadataModel, MetadataCo
...
@@ -169,11 +169,10 @@ function ($, Backbone, _, Utils, Editor, MetadataView, MetadataModel, MetadataCo
},
"Defaults never loaded"
,
1000
);
},
"Defaults never loaded"
,
1000
);
runs
(
function
()
{
runs
(
function
()
{
var
displayNameValue
=
collection
[
0
].
getValue
(),
videoUrlValue
=
collection
[
1
].
getValue
();
var
displayNameValue
=
collection
[
0
].
getValue
();
expect
(
displayNameValue
).
toEqual
(
'default'
);
var
videoUrlValue
=
collection
[
1
].
getValue
();
expect
(
displayNameValue
).
toBe
(
'default'
);
expect
(
videoUrlValue
).
toEqual
([
expect
(
videoUrlValue
).
toEqual
([
'http://youtu.be/OEoXaMPEzfM'
,
'http://youtu.be/OEoXaMPEzfM'
,
'default.mp4'
,
'default.mp4'
,
...
@@ -237,13 +236,13 @@ function ($, Backbone, _, Utils, Editor, MetadataView, MetadataModel, MetadataCo
...
@@ -237,13 +236,13 @@ function ($, Backbone, _, Utils, Editor, MetadataView, MetadataModel, MetadataCo
var
html5SourcesValue
=
collection
[
2
].
getValue
();
var
html5SourcesValue
=
collection
[
2
].
getValue
();
var
youtubeValue
=
collection
[
3
].
getValue
();
var
youtubeValue
=
collection
[
3
].
getValue
();
expect
(
displayNameValue
).
to
Be
(
'display value'
);
expect
(
displayNameValue
).
to
Equal
(
'display value'
);
expect
(
subValue
).
to
Be
(
'default'
);
expect
(
subValue
).
to
Equal
(
'default'
);
expect
(
html5SourcesValue
).
toEqual
([
expect
(
html5SourcesValue
).
toEqual
([
'video.mp4'
,
'video.mp4'
,
'video.webm'
'video.webm'
]);
]);
expect
(
youtubeValue
).
to
Be
(
'12345678901'
);
expect
(
youtubeValue
).
to
Equal
(
'12345678901'
);
});
});
});
});
...
@@ -256,13 +255,13 @@ function ($, Backbone, _, Utils, Editor, MetadataView, MetadataModel, MetadataCo
...
@@ -256,13 +255,13 @@ function ($, Backbone, _, Utils, Editor, MetadataView, MetadataModel, MetadataCo
html5SourcesValue
=
collection
[
2
].
getValue
(),
html5SourcesValue
=
collection
[
2
].
getValue
(),
youtubeValue
=
collection
[
3
].
getValue
();
youtubeValue
=
collection
[
3
].
getValue
();
expect
(
displayNameValue
).
to
Be
(
'default'
);
expect
(
displayNameValue
).
to
Equal
(
'default'
);
expect
(
subValue
).
to
Be
(
'default'
);
expect
(
subValue
).
to
Equal
(
'default'
);
expect
(
html5SourcesValue
).
toEqual
([
expect
(
html5SourcesValue
).
toEqual
([
'default.mp4'
,
'default.mp4'
,
'default.webm'
'default.webm'
]);
]);
expect
(
youtubeValue
).
to
Be
(
'OEoXaMPEzfM'
);
expect
(
youtubeValue
).
to
Equal
(
'OEoXaMPEzfM'
);
});
});
it
(
'Youtube Id is not adjusted'
,
function
()
{
it
(
'Youtube Id is not adjusted'
,
function
()
{
...
@@ -283,7 +282,7 @@ function ($, Backbone, _, Utils, Editor, MetadataView, MetadataModel, MetadataCo
...
@@ -283,7 +282,7 @@ function ($, Backbone, _, Utils, Editor, MetadataView, MetadataModel, MetadataCo
'video.mp4'
,
'video.mp4'
,
'video.webm'
'video.webm'
]);
]);
expect
(
youtubeValue
).
to
Be
(
''
);
expect
(
youtubeValue
).
to
Equal
(
''
);
});
});
it
(
'Timed Transcript field is updated'
,
function
()
{
it
(
'Timed Transcript field is updated'
,
function
()
{
...
@@ -294,7 +293,7 @@ function ($, Backbone, _, Utils, Editor, MetadataView, MetadataModel, MetadataCo
...
@@ -294,7 +293,7 @@ function ($, Backbone, _, Utils, Editor, MetadataView, MetadataModel, MetadataCo
var
collection
=
metadataCollection
.
models
,
var
collection
=
metadataCollection
.
models
,
subValue
=
collection
[
1
].
getValue
();
subValue
=
collection
[
1
].
getValue
();
expect
(
subValue
).
to
Be
(
'test_value'
);
expect
(
subValue
).
to
Equal
(
'test_value'
);
});
});
it
(
'Timed Transcript field is updated just once'
,
function
()
{
it
(
'Timed Transcript field is updated just once'
,
function
()
{
...
@@ -309,7 +308,7 @@ function ($, Backbone, _, Utils, Editor, MetadataView, MetadataModel, MetadataCo
...
@@ -309,7 +308,7 @@ function ($, Backbone, _, Utils, Editor, MetadataView, MetadataModel, MetadataCo
transcripts
.
syncAdvancedTab
(
metadataCollection
);
transcripts
.
syncAdvancedTab
(
metadataCollection
);
transcripts
.
syncAdvancedTab
(
metadataCollection
);
transcripts
.
syncAdvancedTab
(
metadataCollection
);
expect
(
subModel
.
setValue
.
calls
.
length
).
to
Be
(
1
);
expect
(
subModel
.
setValue
.
calls
.
length
).
to
Equal
(
1
);
});
});
});
});
...
...
cms/static/js_spec/transcripts/videolist_spec.js
View file @
bf9e525e
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment