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
348b037b
Commit
348b037b
authored
Oct 18, 2013
by
Valera Rozuvan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixing Jasmine tests. Adding tests for start end time checking.
parent
0d580d00
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
75 additions
and
1 deletions
+75
-1
common/lib/xmodule/xmodule/js/spec/video/general_spec.js
+72
-0
common/lib/xmodule/xmodule/js/spec/video/video_player_spec.js
+3
-1
No files found.
common/lib/xmodule/xmodule/js/spec/video/general_spec.js
View file @
348b037b
...
@@ -184,6 +184,78 @@
...
@@ -184,6 +184,78 @@
});
});
});
});
describe
(
'checking start and end times'
,
function
()
{
beforeEach
(
function
()
{
loadFixtures
(
'video.html'
);
});
it
(
'both times are proper'
,
function
()
{
$
(
'#example'
).
find
(
'.video'
)
.
data
({
'start'
:
12
,
'end'
:
24
});
state
=
new
Video
(
'#example'
);
expect
(
state
.
config
.
start
).
toBe
(
12
);
expect
(
state
.
config
.
end
).
toBe
(
24
);
});
it
(
'start time is invalid'
,
function
()
{
$
(
'#example'
).
find
(
'.video'
)
.
data
({
'start'
:
''
,
'end'
:
24
});
state
=
new
Video
(
'#example'
);
expect
(
state
.
config
.
start
).
toBe
(
0
);
expect
(
state
.
config
.
end
).
toBe
(
24
);
});
it
(
'end time is invalid'
,
function
()
{
$
(
'#example'
).
find
(
'.video'
)
.
data
({
'start'
:
12
,
'end'
:
''
});
state
=
new
Video
(
'#example'
);
expect
(
state
.
config
.
start
).
toBe
(
12
);
expect
(
state
.
config
.
end
).
toBe
(
null
);
});
it
(
'start time is less than 0'
,
function
()
{
$
(
'#example'
).
find
(
'.video'
)
.
data
({
'start'
:
-
12
,
'end'
:
24
});
state
=
new
Video
(
'#example'
);
expect
(
state
.
config
.
start
).
toBe
(
0
);
expect
(
state
.
config
.
end
).
toBe
(
24
);
});
it
(
'start time is greater than end time'
,
function
()
{
$
(
'#example'
).
find
(
'.video'
)
.
data
({
'start'
:
42
,
'end'
:
24
});
state
=
new
Video
(
'#example'
);
expect
(
state
.
config
.
start
).
toBe
(
42
);
expect
(
state
.
config
.
end
).
toBe
(
null
);
});
});
describe
(
'multiple YT on page'
,
function
()
{
describe
(
'multiple YT on page'
,
function
()
{
var
state1
,
state2
,
state3
;
var
state1
,
state2
,
state3
;
...
...
common/lib/xmodule/xmodule/js/spec/video/video_player_spec.js
View file @
348b037b
...
@@ -114,7 +114,9 @@
...
@@ -114,7 +114,9 @@
showinfo
:
0
,
showinfo
:
0
,
enablejsapi
:
1
,
enablejsapi
:
1
,
modestbranding
:
1
,
modestbranding
:
1
,
html5
:
1
html5
:
1
,
start
:
0
,
end
:
null
},
},
videoId
:
'cogebirgzzM'
,
videoId
:
'cogebirgzzM'
,
events
:
{
events
:
{
...
...
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