Commit 7bf9c1a7 by Ben McMorran

Add test for non URL characters

parent 1778c157
define(["jquery", "js/spec_helpers/create_sinon", "js/spec_helpers/view_helpers", "js/views/course_rerun",
"js/views/utils/create_course_utils"],
"js/views/utils/create_course_utils", "jquery.simulate"],
function ($, create_sinon, view_helpers, CourseRerunUtils, CreateCourseUtilsFactory) {
describe("Create course rerun page", function () {
var selectors = {
......@@ -100,6 +100,14 @@ define(["jquery", "js/spec_helpers/create_sinon", "js/spec_helpers/view_helpers"
setErrorMessage(selectors.org, '');
expect($(selectors.save)).toHaveClass(classes.disabled);
});
it("shows an error message when non URL characters are entered", function () {
var input = $(selectors.org);
expect(input.parent()).not.toHaveClass(classes.error);
input.val("%")
input.simulate("keyup", { keyCode: $.simulate.keyCode.ENTER });
expect(input.parent()).toHaveClass(classes.error);
});
});
it("saves course reruns", function () {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment