@@ -3,22 +3,12 @@ import defaultCommands from 'src/lib/defaultCommands.js';
33import defaultOptions from 'src/lib/defaultOptions.js' ;
44import * as utils from 'tests/unit/utils.js' ;
55import rangy from 'rangy' ;
6-
6+ import { testFormat } from './testFormat' ;
77
88var $textarea ;
99var sceditor ;
1010var $fixture = document . getElementById ( 'qunit-module-fixture' ) ;
1111
12- var testFormat = function ( ) {
13- this . toHtml = function ( ) {
14- return '<p><b>test wysiwyg</b></p>' ;
15- } ;
16-
17- this . toSource = function ( ) {
18- return '<p><b>test source</b></p>' ;
19- } ;
20- } ;
21-
2212var reloadEditor = function ( config ) {
2313 reloadEditor . isCustomConfig = ! ! config ;
2414
@@ -433,37 +423,9 @@ QUnit.test('updateOriginal()', function (assert) {
433423
434424 sceditor . getRangeHelper ( ) . clear ( ) ;
435425 sceditor . updateOriginal ( ) ;
436-
426+
437427 assert . htmlEqual ( textarea . value , '<div>text 1234...</div>' ) ;
438428} ) ;
439- /*
440- QUnit.test('Insert image XSS', function (assert) {
441- var done = assert.async();
442-
443- reloadEditor({});
444-
445- var called = false;
446- sceditor.getBody().xss = function () {
447- called = true;
448- };
449-
450- const button = document.getElementsByClassName('sceditor-button-image')[0];
451- defaultCommands.image.exec.call(sceditor, button);
452-
453- const dropdown = document.getElementsByClassName('sceditor-insertimage')[0];
454- const input = document.getElementById('link');
455- const insertButton = dropdown.getElementsByClassName('button')[0];
456-
457- input.outerHTML = '<img src="http://url.to.file.which/not.exist" onerror=body.xss();>';
458- insertButton.click();
459-
460- sceditor.getBody().addEventListener('error', function () {
461- setTimeout(function () {
462- assert.notOk(called);
463- done();
464- }, 1);
465- }, true);
466- });*/
467429
468430QUnit . test ( 'Insert HTML filter JS' , function ( assert ) {
469431 var done = assert . async ( ) ;
0 commit comments