Commit 7e7abbb6 by Dmitry Viskov Committed by Bill Filler

WYSISYG editor for prompts (in studio) - new js test

parent e77b0262
......@@ -29,6 +29,10 @@ describe("OpenAssessment.EditPromptViews", function() {
view = new OpenAssessment.EditPromptsView(element, notifier);
});
afterEach(function() {
OpenAssessment.Prompt.prototype.tinyMCEEnabled = undefined;
});
it("reads prompts from the editor", function() {
// This assumes a particular structure of the DOM,
// which is set by the HTML fixture.
......@@ -59,6 +63,16 @@ describe("OpenAssessment.EditPromptViews", function() {
description: ""
});
});
it("creates new html prompts", function() {
OpenAssessment.Prompt.prototype.tinyMCEEnabled = true;
spyOn(OpenAssessment.Prompt.prototype, 'attachWysiwygToPrompt');
spyOn(OpenAssessment.Prompt.prototype, 'addHandler');
view.addPrompt();
expect(OpenAssessment.Prompt.prototype.attachWysiwygToPrompt).toHaveBeenCalled();
expect(OpenAssessment.Prompt.prototype.addHandler).toHaveBeenCalled();
});
});
describe("OpenAssessment.EditPromptViews after release", 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