feat: add video sharing config change signal (#32211)
* feat: add tracking to video sharing options change * test: add tracking to video sharing options change
This commit is contained in:
@@ -883,6 +883,24 @@ describe('CourseOutlinePage', function() {
|
||||
expect($('div.course-video-sharing')).not.toExist();
|
||||
expect(selectedOption()).not.toExist();
|
||||
});
|
||||
|
||||
it('tracks changes to video sharing option', function() {
|
||||
createCourse({
|
||||
video_sharing_enabled: true,
|
||||
video_sharing_options: 'all-on',
|
||||
video_sharing_doc_url: 'http://rick.roll'
|
||||
});
|
||||
|
||||
selectedOption().val('per-video').trigger('change');
|
||||
|
||||
expect(window.analytics.track).toHaveBeenCalledWith(
|
||||
'edx.social.video_sharing_options.changed',
|
||||
{
|
||||
course_id: 'mock-course',
|
||||
video_sharing_options: 'per-video'
|
||||
}
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('Section', function() {
|
||||
|
||||
@@ -29,6 +29,7 @@ define([
|
||||
if (event.type === "change") {
|
||||
event.preventDefault();
|
||||
this.updateVideoSharingConfiguration(event.target.value);
|
||||
this.trackVideoSharingConfigurationChange(event.target.value);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -38,6 +39,16 @@ define([
|
||||
});
|
||||
},
|
||||
|
||||
trackVideoSharingConfigurationChange: function (value) {
|
||||
window.analytics.track(
|
||||
'edx.social.video_sharing_options.changed',
|
||||
{
|
||||
course_id: this.model.id,
|
||||
video_sharing_options: value
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
refresh: function () {
|
||||
this.model.fetch({
|
||||
success: this.render.bind(this),
|
||||
|
||||
Reference in New Issue
Block a user