diff --git a/cms/static/coffee/spec/main.coffee b/cms/static/coffee/spec/main.coffee
index d80ab05764..9bd64c5a2a 100644
--- a/cms/static/coffee/spec/main.coffee
+++ b/cms/static/coffee/spec/main.coffee
@@ -234,6 +234,7 @@ define([
"js/spec/views/pages/group_configurations_spec",
"js/spec/views/pages/course_outline_spec",
"js/spec/views/pages/course_rerun_spec",
+ "js/spec/views/pages/index_spec",
"js/spec/views/modals/base_modal_spec",
"js/spec/views/modals/edit_xblock_spec",
diff --git a/cms/static/js/index.js b/cms/static/js/index.js
index bf7feb89b3..de124f224b 100644
--- a/cms/static/js/index.js
+++ b/cms/static/js/index.js
@@ -1,4 +1,4 @@
-require(["domReady", "jquery", "underscore", "js/utils/cancel_on_escape"],
+define(["domReady", "jquery", "underscore", "js/utils/cancel_on_escape"],
function (domReady, $, _, CancelOnEscape) {
var dismissNotification = function (e) {
@@ -172,9 +172,15 @@ require(["domReady", "jquery", "underscore", "js/utils/cancel_on_escape"],
}
};
-
- domReady(function () {
+ var onReady = function () {
$('.new-course-button').bind('click', addNewCourse);
$('.dismiss-button').bind('click', dismissNotification);
- });
+ };
+
+ domReady(onReady);
+
+ return {
+ dismissNotification: dismissNotification,
+ onReady: onReady
+ };
});
diff --git a/cms/static/js/spec/views/pages/index_spec.js b/cms/static/js/spec/views/pages/index_spec.js
new file mode 100644
index 0000000000..bffe8b5e3b
--- /dev/null
+++ b/cms/static/js/spec/views/pages/index_spec.js
@@ -0,0 +1,24 @@
+define(["jquery", "js/spec_helpers/create_sinon", "js/spec_helpers/view_helpers", "js/index"],
+ function ($, create_sinon, view_helpers, IndexPage) {
+ describe("Course listing page", function () {
+ var mockIndexPageHTML = readFixtures('mock/mock-index-page.underscore');
+
+ beforeEach(function () {
+ view_helpers.installMockAnalytics();
+ appendSetFixtures(mockIndexPageHTML);
+ IndexPage.onReady();
+ });
+
+ afterEach(function () {
+ view_helpers.removeMockAnalytics();
+ delete window.source_course_key;
+ });
+
+
+ it("can dismiss notifications", function () {
+ var requests = create_sinon.requests(this);
+ $('.dismiss-button').click();
+ create_sinon.expectJsonRequest(requests, 'DELETE', 'dummy_dismiss_url');
+ });
+ });
+ });
\ No newline at end of file
diff --git a/cms/static/js/views/course_rerun.js b/cms/static/js/views/course_rerun.js
index 57bba6351c..529e9029a9 100644
--- a/cms/static/js/views/course_rerun.js
+++ b/cms/static/js/views/course_rerun.js
@@ -1,5 +1,5 @@
-define(["domReady", "jquery", "underscore", "js/utils/cancel_on_escape"],
- function (domReady, $, _, CancelOnEscape) {
+define(["domReady", "jquery", "underscore"],
+ function (domReady, $, _) {
var saveRerunCourse = function (e) {
e.preventDefault();
@@ -93,7 +93,6 @@ define(["domReady", "jquery", "underscore", "js/utils/cancel_on_escape"],
$courseRun.focus().select();
$('.rerun-course-save').on('click', saveRerunCourse);
$cancelButton.bind('click', cancelRerunCourse);
- CancelOnEscape($cancelButton);
$('.cancel-button').bind('click', cancelRerunCourse);
// Check that a course (org, number, run) doesn't use any special characters
diff --git a/cms/templates/js/mock/mock-course-rerun-notification.underscore b/cms/templates/js/mock/mock-course-rerun-notification.underscore
new file mode 100644
index 0000000000..68a0ddea8b
--- /dev/null
+++ b/cms/templates/js/mock/mock-course-rerun-notification.underscore
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
This course was created as a re-run. Some manual configuration is needed.
+
+
Be sure to review and reset all dates (the Course Start Date was set to January 1, 2030); set up the
+ course team; review course updates and other assets for dated material; and seed the discussions and
+ wiki.
+
+
+
+
+
+
\ No newline at end of file
diff --git a/cms/templates/js/mock/mock-index-page.underscore b/cms/templates/js/mock/mock-index-page.underscore
new file mode 100644
index 0000000000..f63f12e571
--- /dev/null
+++ b/cms/templates/js/mock/mock-index-page.underscore
@@ -0,0 +1,168 @@
+
+
+
+
+
+
+
+
Welcome, user!
+
+
Here are all of the courses you currently have access to in Studio:
+
+
+
+
+
+
+
+
Courses Being Processed
+
+
+
+ -
+
+
+
Demo Course
+
+
+
+ Organization: edX
+
+
+ Course Number:
+ DM101
+
+
+ Course Run: 2014
+
+
+
+
+
+ - This re-run processing status:
+ -
+
+ Configuring as re-run
+
+
+
+
+
+
The new course will be added to your course list in 5-10 minutes. Return to this page or refresh it to update the course list. The new course will need some manual configuration.
+
+
+
+
+
+
+ -
+
+
+
Demo Course 2
+
+
+
+ Organization: edX
+
+
+ Course Number:
+ DM102
+
+
+ Course Run: 2014
+
+
+
+
+
+ - This re-run processing status:
+ -
+
+ Configuration Error
+
+
+
+
+
+
A system error occurred while your course was being processed. Please go to the original course to try the re-run again, or contact your PM for assistance.
+
+
+
+
+
+
+
+
+