File tree Expand file tree Collapse file tree 2 files changed +13
-10
lines changed
js/__internal/ui/html_editor/matchers
testing/tests/DevExpress.ui.widgets.htmlEditor/htmlEditorParts Expand file tree Collapse file tree 2 files changed +13
-10
lines changed Original file line number Diff line number Diff line change @@ -21,8 +21,8 @@ function removeNewLineChar(operations) {
2121 newLineOperation . insert = newLineOperation . insert . trim ( ) ;
2222}
2323
24- function isTextOp ( op ) : boolean {
25- return typeof op === 'string' ;
24+ function isStringInsert ( insert : unknown ) : boolean {
25+ return typeof insert === 'string' ;
2626}
2727
2828const getMatcher = ( quill ) => {
@@ -34,7 +34,7 @@ const getMatcher = (quill) => {
3434
3535 const insertOperation = ops [ 0 ] ;
3636
37- if ( ! isTextOp ( insertOperation . insert ) ) {
37+ if ( ! isStringInsert ( insertOperation . insert ) ) {
3838 return delta ;
3939 }
4040
Original file line number Diff line number Diff line change @@ -71,21 +71,24 @@ export default function() {
7171 const spy = sinon . spy ( console , 'error' ) ;
7272 const value = `<p class="${ className } "><br><br></p>` ;
7373 const $element = $ ( '#htmlEditor' ) ;
74- $element . dxHtmlEditor ( {
75- value
76- } ) . dxHtmlEditor ( 'instance' ) ;
7774
78- assert . strictEqual ( spy . called , false , 'No console error was thrown' ) ;
79- spy . restore ( ) ;
75+ try {
76+ $element . dxHtmlEditor ( { value } ) . dxHtmlEditor ( 'instance' ) ;
77+
78+ assert . strictEqual ( spy . called , false , 'No console error was thrown' ) ;
79+ } finally {
80+ spy . restore ( ) ;
81+ }
8082 } ) ;
8183
8284 test ( `editor should preserve double <br> in list paragraph for ${ className } class (T1292587)` , function ( assert ) {
8385 const value = `<p class="${ className } "><br><br></p>` ;
8486 const $element = $ ( '#htmlEditor' ) ;
85- $element . dxHtmlEditor ( {
87+ const htmlEditor = $element . dxHtmlEditor ( {
8688 value
8789 } ) . dxHtmlEditor ( 'instance' ) ;
88- const markup = $element . find ( `.${ CONTENT_CLASS } ` ) . html ( ) ;
90+
91+ const markup = htmlEditor . option ( 'value' ) ;
8992 const $markup = $ ( '<div>' ) . html ( markup ) ;
9093
9194 assert . strictEqual ( $markup . find ( 'br' ) . length , 2 , 'Two soft breaks preserved' ) ;
You can’t perform that action at this time.
0 commit comments