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
ee344980
Commit
ee344980
authored
Mar 29, 2017
by
Brian Jacobel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add events to course outline, and add JS tests
parent
4ba0bfcd
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
2 deletions
+34
-2
common/test/acceptance/tests/lms/test_lms_courseware.py
+1
-0
openedx/features/course_experience/static/course_experience/js/course_outline_factory.js
+12
-1
openedx/features/course_experience/static/course_experience/js/spec/course_outline_factory_spec.js
+21
-1
No files found.
common/test/acceptance/tests/lms/test_lms_courseware.py
View file @
ee344980
...
...
@@ -592,6 +592,7 @@ class CoursewareMultipleVerticalsTest(CoursewareMultipleVerticalsTestBase):
selected_events
)
# TODO: Delete as part of TNL-6546 / LEARNER-71
def
test_link_clicked_events
(
self
):
"""
Given that I am a user in the courseware
...
...
openedx/features/course_experience/static/course_experience/js/course_outline_factory.js
View file @
ee344980
...
...
@@ -3,9 +3,10 @@
define
([
'jquery'
,
'logger'
,
'edx-ui-toolkit/js/utils/constants'
],
function
(
$
,
constants
)
{
function
(
$
,
Logger
,
constants
)
{
return
function
(
root
)
{
// In the future this factory could instantiate a Backbone view or React component that handles events
$
(
root
).
keydown
(
function
(
event
)
{
...
...
@@ -23,6 +24,16 @@
break
;
}
});
$
(
'a:not([href^="#"])'
).
click
(
function
(
event
)
{
Logger
.
log
(
'edx.ui.lms.link_clicked'
,
{
current_url
:
window
.
location
.
href
,
target_url
:
event
.
currentTarget
.
href
}
);
});
};
}
);
...
...
openedx/features/course_experience/static/course_experience/js/spec/course_outline_factory_spec.js
View file @
ee344980
define
([
'jquery'
,
'logger'
,
'edx-ui-toolkit/js/utils/constants'
,
'course_experience/js/course_outline_factory'
],
function
(
$
,
constants
,
CourseOutlineFactory
)
{
function
(
$
,
Logger
,
constants
,
CourseOutlineFactory
)
{
'use strict'
;
describe
(
'Course outline factory'
,
function
()
{
...
...
@@ -81,6 +82,25 @@ define([
});
});
});
describe
(
'eventing'
,
function
()
{
beforeEach
(
function
()
{
loadFixtures
(
'course_experience/fixtures/course-outline-fragment.html'
);
CourseOutlineFactory
(
'.block-tree'
);
spyOn
(
Logger
,
'log'
);
});
it
(
'sends an event when an outline section is clicked'
,
function
()
{
$
(
'a.focusable:contains("Homework - Labs and Demos")'
).
click
();
expect
(
Logger
.
log
).
toHaveBeenCalledWith
(
'edx.ui.lms.link_clicked'
,
{
target_url
:
window
.
location
.
origin
+
'/courses/course-v1:edX+DemoX+Demo_Course/jump_to/block-v1:edX+DemoX+Demo_Course+type'
+
'@sequential+block@graded_simulations'
,
current_url
:
window
.
location
.
toString
()
});
});
});
});
}
);
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