describe("Wysiwyg.insertHtml", function () { beforeEach(function () { $("#id1").wysiwyg({ rmUnusedControls: true, controls: { bold: { visible: true }, html: { visible: true } } }); }); afterEach(function () { $("textarea").wysiwyg("clear").wysiwyg("destroy"); }); it('should insert correct html text 1', function () { $("#id1").wysiwyg("insertHtml", "

111

"); var content = $("#id1").val(); expect(content.indexOf("

111

")).not.toEqual(-1); }); it('should insert correct plain text', function () { $("#id1").wysiwyg("insertHtml", "plain text"); var content = $("#id1").val(); expect(content.indexOf("plain text")).not.toEqual(-1); }); it('should insert correct html text 2', function () { $("#id1").wysiwyg("insertHtml", "

111

222

333

"); var content = $("#id1").val(); expect(content.indexOf("

111

222

333

")).not.toEqual(-1); }); it('should insert correct html text 3', function () { $("#id1").wysiwyg("insertHtml", "text

111

222

333

text"); var content = $("#id1").val(); expect(content.indexOf("text

111

222

333

text")).not.toEqual(-1); }); });