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:
@@ -84,7 +84,7 @@ define ["jquery", "common/js/spec_helpers/ajax_helpers", "squire"],
|
||||
expect(@confirmationSpies.constructor).not.toHaveBeenCalled()
|
||||
expect(@collection.contains(@model)).toBeTruthy()
|
||||
# return a success response
|
||||
requests[0].respond(200)
|
||||
requests[0].respond(204)
|
||||
expect(@confirmationSpies.constructor).toHaveBeenCalled()
|
||||
expect(@confirmationSpies.show).toHaveBeenCalled()
|
||||
savingOptions = @confirmationSpies.constructor.calls.mostRecent().args[0]
|
||||
@@ -118,7 +118,7 @@ define ["jquery", "common/js/spec_helpers/ajax_helpers", "squire"],
|
||||
expect(savingOptions.title).toMatch("Saving")
|
||||
expect(@model.get("locked")).toBeFalsy()
|
||||
# return a success response
|
||||
requests[0].respond(200)
|
||||
requests[0].respond(204)
|
||||
expect(@savingSpies.hide).toHaveBeenCalled()
|
||||
expect(@model.get("locked")).toBeTruthy()
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@ define ["js/models/textbook", "js/models/chapter", "js/collections/chapter", "js
|
||||
savingOptions = @savingSpies.constructor.calls.mostRecent().args[0]
|
||||
expect(savingOptions.title).toMatch(/Deleting/)
|
||||
# return a success response
|
||||
requests[0].respond(200)
|
||||
requests[0].respond(204)
|
||||
expect(@savingSpies.hide).toHaveBeenCalled()
|
||||
expect(@collection.contains(@model)).toBeFalsy()
|
||||
|
||||
|
||||
@@ -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');
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 () {
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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 () {
|
||||
|
||||
Reference in New Issue
Block a user