Skip to content

Commit 05ffc18

Browse files
committed
fix: update changelog for version 4.8.3 and improve source code tests
1 parent 6e319f6 commit 05ffc18

2 files changed

Lines changed: 28 additions & 12 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@
99
> - :house: [Internal]
1010
> - :nail_care: [Polish]
1111

12+
## 4.8.3
13+
14+
#### :house: Internal
15+
16+
- feat: enhance editor functionality with MutationObserver and refactor initialization methods
17+
1218
## 4.8.1
1319

1420
#### :rocket: New Feature

src/plugins/source/source.test.js

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Released under MIT see LICENSE.txt in the project root for license information.
44
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
55
*/
6+
67
describe('Source code test', function () {
78
describe('Init', function () {
89
it('After init container must has source editor container', function (done) {
@@ -443,23 +444,29 @@ describe('Source code test', function () {
443444
sourceEditor: 'ace',
444445
beautifyHTML: false,
445446
events: {
446-
sourceEditorReady: function (jodit) {
447+
afterInit: function (jodit) {
447448
try {
448449
jodit.s.focus();
449450
jodit.value =
450451
'<p>test <span>test|</span> test</p>';
452+
453+
jodit.e.on('sourceEditorReady', async () => {
454+
try {
455+
expect(jodit.value).equals(
456+
'<p>test <span>testloop</span> test</p>'
457+
);
458+
mockPromise();
459+
460+
done();
461+
} catch (e) {
462+
done(e);
463+
}
464+
});
451465
setCursorToChar(jodit);
452466
jodit.setMode(Jodit.MODE_SOURCE);
453-
454467
jodit.s.insertHTML('loop');
455-
456-
expect(jodit.value).equals(
457-
'<p>test <span>testloop</span> test</p>'
458-
);
459-
mockPromise();
460-
461-
done();
462468
} catch (e) {
469+
console.error(e);
463470
done(e);
464471
}
465472
}
@@ -514,16 +521,19 @@ describe('Source code test', function () {
514521
await editor.async.requestIdlePromise();
515522
editor.setMode(Jodit.MODE_SOURCE);
516523
await editor.async.requestIdlePromise();
517-
518-
expect(sortAttributes(editor.value)).equals(
524+
expect(
525+
sortAttributes(editor.value).replace(/\n/g, '')
526+
).equals(
519527
'<p>some text<script async="" id="cr-embed-c8ea384249b100dd506fab87" src="https://post.crowdriff.com/js/crowdriff.js" type="text/javascript"></script></p>'
520528
);
521529

522530
await editor.async.requestIdlePromise();
523531
editor.setMode(Jodit.MODE_WYSIWYG);
524532
await editor.async.requestIdlePromise();
525533

526-
expect(sortAttributes(editor.value)).equals(
534+
expect(
535+
sortAttributes(editor.value).replace(/\n/g, '')
536+
).equals(
527537
'<p>some text<script async="" id="cr-embed-c8ea384249b100dd506fab87" src="https://post.crowdriff.com/js/crowdriff.js" type="text/javascript"></script></p>'
528538
);
529539
});

0 commit comments

Comments
 (0)