Skip to content

Commit 87c99d4

Browse files
committed
test is not needed
1 parent 66a5cfc commit 87c99d4

2 files changed

Lines changed: 13 additions & 40 deletions

File tree

tests/unit/lib/SCEditor.js

Lines changed: 2 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,12 @@ import defaultCommands from 'src/lib/defaultCommands.js';
33
import defaultOptions from 'src/lib/defaultOptions.js';
44
import * as utils from 'tests/unit/utils.js';
55
import rangy from 'rangy';
6-
6+
import { testFormat } from './testFormat';
77

88
var $textarea;
99
var sceditor;
1010
var $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-
2212
var 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

468430
QUnit.test('Insert HTML filter JS', function (assert) {
469431
var done = assert.async();

tests/unit/lib/testFormat.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
export class testFormat {
2+
constructor() {
3+
this.toHtml = function () {
4+
return '<p><b>test wysiwyg</b></p>';
5+
};
6+
7+
this.toSource = function () {
8+
return '<p><b>test source</b></p>';
9+
};
10+
}
11+
}

0 commit comments

Comments
 (0)