-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ELEMENTS-1124: switch nuxeo-html-editor to Quill
- Loading branch information
1 parent
6d88732
commit 22f60d1
Showing
46 changed files
with
1,134 additions
and
2,889 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
**/node_modules/ | ||
**/coverage/ | ||
ui/import-href.js | ||
ui/widgets/alloy/ | ||
ui/widgets/nuxeo-selectivity.js | ||
ui/viewers/pdfjs | ||
ui/dataviz/randomColor.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
**/node_modules/ | ||
**/coverage/ | ||
ui/import-href.js | ||
ui/widgets/alloy/ | ||
ui/widgets/nuxeo-selectivity.js | ||
ui/viewers/pdfjs | ||
ui/dataviz/randomColor.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/** | ||
@license | ||
(C) Copyright Nuxeo Corp. (http://nuxeo.com/) | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
import { fixture, isElementVisible, html } from '@nuxeo/nuxeo-elements/test/test-helpers'; | ||
import '../widgets/nuxeo-html-editor.js'; | ||
|
||
/* eslint-disable no-unused-expressions */ | ||
suite('<nuxeo-html-editor>', () => { | ||
test('should display the placeholder when empty', async () => { | ||
const editor = await fixture( | ||
html` | ||
<nuxeo-html-editor></nuxeo-html-editor> | ||
`, | ||
); | ||
expect(editor._editor.root.dataset.placeholder).to.equal('Type here...'); | ||
}); | ||
|
||
test('should sync the html value', async () => { | ||
const editor = await fixture( | ||
html` | ||
<nuxeo-html-editor value="Hello"></nuxeo-html-editor> | ||
`, | ||
); | ||
await new Promise((resolve) => { | ||
editor.addEventListener('value-changed', () => resolve()); | ||
editor._editor.insertText(editor._editor.getLength() - 1, ' world!', 'user'); | ||
}); | ||
expect(editor.value).to.equal(`<p>Hello world!</p>`); | ||
}); | ||
|
||
test('should hide the toolbar when readonly', async () => { | ||
const editor = await fixture( | ||
html` | ||
<nuxeo-html-editor read-only></nuxeo-html-editor> | ||
`, | ||
); | ||
expect(isElementVisible(editor._editor.getModule('toolbar').container)).to.be.false; | ||
}); | ||
}); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.