Assorted test and dependency fixes to cms-squire and cms

isRejected is deprecated.

Actually serve the slick library in LMS jasmine tests

customwmd doesn't need to wait for DOM ready event

... In order to define a class and extend the Markdown class.
This commit is contained in:
cahrens
2016-02-23 12:44:01 -05:00
committed by Brian Jacobel
parent 15f148141f
commit 4ba07bf7a4
22 changed files with 226 additions and 185 deletions

View File

@@ -254,7 +254,7 @@ function(_, Course, CertificatesCollection, CertificateModel, CertificateDetails
this.view.$(SELECTORS.signatory_panel_save).click();
ViewHelpers.verifyNotificationShowing(notificationSpy, /Saving/);
requests[0].respond(200);
requests[0].respond(204);
ViewHelpers.verifyNotificationHidden(notificationSpy);
expect(this.view.$(SELECTORS.signatory_name_value)).toContainText('New Signatory Test Name');

View File

@@ -7,7 +7,8 @@ define([ // jshint ignore:line
'js/certificates/views/certificate_preview',
'common/js/spec_helpers/template_helpers',
'common/js/spec_helpers/view_helpers',
'common/js/spec_helpers/ajax_helpers'
'common/js/spec_helpers/ajax_helpers',
'jasmine-stealth'
],
function(_, $, Course, CertificatePreview, TemplateHelpers, ViewHelpers, AjaxHelpers) {
'use strict';

View File

@@ -331,7 +331,7 @@ define(["js/utils/drag_and_drop", "common/js/components/views/feedback_notificat
expect(savingOptions.title).toMatch(/Saving/);
expect($('#unit-1')).toHaveClass('was-dropped');
expect(request.requestBody).toEqual('{"children":["fourth-unit-id","first-unit-id"]}');
request.respond(200);
request.respond(204);
expect(this.savingSpies.hide).toHaveBeenCalled();
this.clock.tick(1001);
expect($('#unit-1')).not.toHaveClass('was-dropped');
@@ -360,7 +360,7 @@ define(["js/utils/drag_and_drop", "common/js/components/views/feedback_notificat
expect(request.requestBody).toEqual(
'{"children":["second-unit-id","first-unit-id","third-unit-id"]}'
);
request.respond(200);
request.respond(204);
this.clock.tick(1001);
expect($('#unit-1')).not.toHaveClass('was-dropped');
// parent

View File

@@ -253,6 +253,16 @@ define(["jquery", "common/js/spec_helpers/ajax_helpers", "common/js/components/u
])
]);
// Create a mock Course object as the JS now expects it.
window.course = new Course({
id: '333',
name: 'Course Name',
url_name: 'course_name',
org: 'course_org',
num: 'course_num',
revision: 'course_rev'
});
});
afterEach(function () {

View File

@@ -101,7 +101,7 @@ define(["jquery", "common/js/spec_helpers/ajax_helpers", "common/js/spec_helpers
var values_with_blank = values.slice();
values_with_blank[i] = '';
fillInLibraryFields.apply(this, values_with_blank);
expect($('.create-library li.field.text input[value=]').parent()).toHaveClass('error');
expect($('.create-library li.field.text input').parent()).toHaveClass('error');
expect($('.new-library-save')).toHaveClass('is-disabled');
expect($('.new-library-save')).toHaveAttr('aria-disabled', 'true');
$('.new-library-save').click();

View File

@@ -9,7 +9,7 @@ function ($, AjaxHelpers, ViewHelpers, ManageUsersFactory, ViewUtils) {
var team_member_fixture = readFixtures("team-member.underscore");
function setRole(email, role){
var user_li = $("li.user-item[data-email="+ email + "]");
var user_li = $('li.user-item[data-email="'+ email + '"]');
var role_action = $("li.action-role a.make-"+role, user_li);
expect(role_action).toBeVisible();
role_action.click();

View File

@@ -99,7 +99,7 @@ define(["jquery", "URI", "common/js/spec_helpers/ajax_helpers", "common/js/compo
mimetype: "application/javascript", kind: "url", data: missingJavaScriptUrl
}]
]);
expect(promise.isRejected()).toBe(true);
expect(promise.state()).toBe("rejected");
});
it('Triggers an event to the runtime when a notification-action-button is clicked', function () {