From 832af9c5225d991ee6be1a1338f4cde5296ef101 Mon Sep 17 00:00:00 2001 From: xdan Date: Fri, 12 Jan 2024 00:49:01 +0300 Subject: [PATCH] New version 4.0.2 Read more https://github.com/xdan/jodit/blob/main/CHANGELOG.md --- package-lock.json | 4 +-- package.json | 2 +- src/modules/file-browser/file-browser.test.js | 2 +- src/plugins/delete/delete.test.js | 26 ++++++++++++++----- 4 files changed, 24 insertions(+), 10 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7ae4e1017..65a883119 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "jodit", - "version": "4.0.1", + "version": "4.0.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "jodit", - "version": "4.0.1", + "version": "4.0.2", "license": "MIT", "dependencies": { "autobind-decorator": "^2.4.0" diff --git a/package.json b/package.json index 1c2fbfd04..3955f7e9e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "jodit", - "version": "4.0.1", + "version": "4.0.2", "description": "Jodit is awesome and usefully wysiwyg editor with filebrowser", "main": "build/jodit.min.js", "types": "./types/index.d.ts", diff --git a/src/modules/file-browser/file-browser.test.js b/src/modules/file-browser/file-browser.test.js index 8a7b6fabb..7a3f07c82 100644 --- a/src/modules/file-browser/file-browser.test.js +++ b/src/modules/file-browser/file-browser.test.js @@ -14,7 +14,7 @@ function getFirstItem(fb, index = 0, file = false) { )[index]; } -('filebrowser' in window.skipTest ? describe.skip : describe.only)( +('filebrowser' in window.skipTest ? describe.skip : describe)( 'Jodit FileBrowser Tests', () => { afterEach(() => { diff --git a/src/plugins/delete/delete.test.js b/src/plugins/delete/delete.test.js index b5d496c6a..8d9aa5e71 100644 --- a/src/plugins/delete/delete.test.js +++ b/src/plugins/delete/delete.test.js @@ -6,15 +6,29 @@ describe('Delete plugin', () => { describe('Select all and exec delete command', () => { - it('Should remove all content', () => { - const editor = getJodit(); + [ + ['

test

', ''], + [ + `

You must include the syntax highlighting library yourself, on your site:

+
...
+ +

After that, the library must be initialized

+
Prism.highlightAll()
`, + '' + ] + ].forEach(([input, result]) => { + describe('For input ' + input, () => { + it('Should remove all content. Result: ' + result, () => { + const editor = getJodit(); - editor.value = '

test

'; + editor.value = input; - editor.execCommand('selectall'); - editor.execCommand('delete'); + editor.execCommand('selectall'); + editor.execCommand('delete'); - expect(editor.value).equals(''); + expect(editor.value).equals(result); + }); + }); }); }); });