{"size": 1036, "ext": "js", "max_stars_repo_path": "lms/static/js/spec/courseware/course_home_events_spec.js", "max_stars_repo_name": "memocated/memocate-openedx-theme", "max_stars_repo_stars_event_min_datetime": "2018-09-04T18:05:05.000Z", "max_stars_repo_stars_event_max_datetime": "2018-09-04T18:05:05.000Z", "max_issues_repo_path": "lms/static/js/spec/courseware/course_home_events_spec.js", "max_issues_repo_name": "memocated/memocate-openedx-theme", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "lms/static/js/spec/courseware/course_home_events_spec.js", "max_forks_repo_name": "memocated/memocate-openedx-theme", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 39.8461538462, "max_line_length": 104, "alphanum_fraction": 0.5859073359}
define(['jquery', 'logger', 'js/courseware/course_home_events'], function($, Logger, courseHomeEvents) {
    'use strict';

    describe('Course home page eventing', function() {
        beforeEach(function() {
            loadFixtures('js/fixtures/courseware/course_home_events.html');
            courseHomeEvents();
            spyOn(Logger, 'log');
        });

        it('sends an event when "Resume Course" is clicked', function() {
            $('.last-accessed-link').click();
            expect(Logger.log).toHaveBeenCalledWith('edx.course.home.resume_course.clicked', {
                url: 'http://' +
                window.location.host +
                '/courses/course-v1:edX+DemoX+Demo_Course/courseware/19a30717eff543078a5d94ae9d6c18a5/'
            });
        });

        it('sends an event when "Upgrade to Verified" is clicked', function() {
            $('.date-summary-link').click();
            expect(Logger.log).toHaveBeenCalledWith('edx.course.home.upgrade_verified.clicked', {});
        });
    });
});
