Test notification dismissal on course listing page

This commit is contained in:
Ben McMorran
2014-08-15 11:15:09 -04:00
parent 319b53bb3c
commit 6c8b418331
6 changed files with 229 additions and 7 deletions

View File

@@ -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');
});
});
});