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
54bbfb39
Commit
54bbfb39
authored
Sep 18, 2013
by
Valera Rozuvan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding comments to Jasmine "Video FocusGrabber" tests.
parent
d4343309
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
5 deletions
+24
-5
common/lib/xmodule/xmodule/js/spec/video/video_focus_grabber_spec.js
+24
-5
No files found.
common/lib/xmodule/xmodule/js/spec/video/video_focus_grabber_spec.js
View file @
54bbfb39
...
@@ -28,7 +28,10 @@
...
@@ -28,7 +28,10 @@
jQuery
.
fx
.
off
=
true
;
jQuery
.
fx
.
off
=
true
;
});
});
it
(
'check existence of focus grabber elements and their position'
,
function
()
{
it
(
'check existence of focus grabber elements and their position'
,
function
()
{
var
firstFGEl
=
state
.
el
.
find
(
'.focus_grabber.first'
),
var
firstFGEl
=
state
.
el
.
find
(
'.focus_grabber.first'
),
lastFGEl
=
state
.
el
.
find
(
'.focus_grabber.last'
),
lastFGEl
=
state
.
el
.
find
(
'.focus_grabber.last'
),
tcWrapperEl
=
state
.
el
.
find
(
'.tc-wrapper'
);
tcWrapperEl
=
state
.
el
.
find
(
'.tc-wrapper'
);
...
@@ -47,14 +50,22 @@
...
@@ -47,14 +50,22 @@
expect
(
state
.
focusGrabber
.
elLast
.
attr
(
'tabindex'
)).
toBe
(
-
1
);
expect
(
state
.
focusGrabber
.
elLast
.
attr
(
'tabindex'
)).
toBe
(
-
1
);
});
});
it
(
'when first focus grabber is focused "mousemove" event is triggered, grabbers are disabled'
,
function
()
{
it
(
'when first focus grabber is focused "mousemove" event is '
+
'triggered, grabbers are disabled'
,
function
()
{
state
.
focusGrabber
.
elFirst
.
triggerHandler
(
'focus'
);
state
.
focusGrabber
.
elFirst
.
triggerHandler
(
'focus'
);
expect
(
'mousemove'
).
toHaveBeenTriggeredOn
(
state
.
el
);
expect
(
'mousemove'
).
toHaveBeenTriggeredOn
(
state
.
el
);
expect
(
state
.
focusGrabber
.
disableFocusGrabber
).
toHaveBeenCalled
();
expect
(
state
.
focusGrabber
.
disableFocusGrabber
).
toHaveBeenCalled
();
});
});
it
(
'when last focus grabber is focused "mousemove" event is triggered, grabbers are disabled'
,
function
()
{
it
(
'when last focus grabber is focused "mousemove" event is '
+
'triggered, grabbers are disabled'
,
function
()
{
state
.
focusGrabber
.
elLast
.
triggerHandler
(
'focus'
);
state
.
focusGrabber
.
elLast
.
triggerHandler
(
'focus'
);
expect
(
'mousemove'
).
toHaveBeenTriggeredOn
(
state
.
el
);
expect
(
'mousemove'
).
toHaveBeenTriggeredOn
(
state
.
el
);
...
@@ -62,16 +73,24 @@
...
@@ -62,16 +73,24 @@
});
});
it
(
'after controls hide focus grabbers are enabled'
,
function
()
{
it
(
'after controls hide focus grabbers are enabled'
,
function
()
{
runs
(
function
()
{
runs
(
function
()
{
// Captions should not be "sticky" for the autohide mechanism
// to work.
state
.
videoCaption
.
hideCaptions
(
true
);
state
.
videoCaption
.
hideCaptions
(
true
);
// Make sure that the controls are visible. After this event
// is triggered a count down is started to autohide captions.
state
.
el
.
triggerHandler
(
'mousemove'
);
state
.
el
.
triggerHandler
(
'mousemove'
);
});
});
// Wait for the autohide to happen. We make it +100ms to make sure
// that there is clearly no race conditions for our expect below.
waits
(
state
.
videoControl
.
fadeOutTimeout
+
100
);
waits
(
state
.
videoControl
.
fadeOutTimeout
+
100
);
runs
(
function
()
{
runs
(
function
()
{
expect
(
state
.
focusGrabber
.
enableFocusGrabber
).
toHaveBeenCalled
();
expect
(
state
.
focusGrabber
.
enableFocusGrabber
).
toHaveBeenCalled
();
});
});
});
});
});
});
...
...
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