@@ -339,7 +339,8 @@ ke The <br> World Go Round`)
339
339
340
340
it ( 'always selects the first character if values are too small' , function ( ) {
341
341
setupHighlightEnv ( this , 'ab' )
342
- this . highlightRange ( 'ab' , 'myId' , 0 , 0 )
342
+ const highlightText = undefined // Avoid validation
343
+ this . highlightRange ( highlightText , 'myId' , 0 , 0 )
343
344
const expectedHtml = this . formatHtml (
344
345
`<span class="highlight-comment" data-editable="ui-unwrap" data-highlight="comment" data-word-id="myId">a</span>b`
345
346
)
@@ -349,7 +350,8 @@ ke The <br> World Go Round`)
349
350
350
351
it ( 'always selects the last character if values are too large' , function ( ) {
351
352
setupHighlightEnv ( this , 'ab' )
352
- this . highlightRange ( 'ab' , 'myId' , 2 , 5 )
353
+ const highlightText = undefined // Avoid validation
354
+ this . highlightRange ( highlightText , 'myId' , 2 , 5 )
353
355
const expectedHtml = this . formatHtml (
354
356
`a<span class="highlight-comment" data-editable="ui-unwrap" data-highlight="comment" data-word-id="myId">b</span>`
355
357
)
@@ -512,7 +514,7 @@ ke The <br> World Go Round`)
512
514
513
515
it ( 'extracts a readable text' , function ( ) {
514
516
setupHighlightEnv ( this , '๐ Make The \r\n ๐ Go \n๐' )
515
- this . highlightRange ( '๐ Makeย The ๐ Go ๐' , 'myId' , 0 , 23 )
517
+ this . highlightRange ( '๐ Makeย The \n ๐ Go \n ๐' , 'myId' , 0 , 23 )
516
518
const expectedRanges = {
517
519
myId : {
518
520
text : '๐ Makeย The \n ๐ Go \n๐' ,
@@ -529,7 +531,7 @@ ke The <br> World Go Round`)
529
531
setupHighlightEnv ( this , '๐ Make The \r\n ๐ Go \n๐' )
530
532
let called = 0
531
533
const dispatcher = { notify : ( ) => called ++ }
532
- this . highlightRange ( '๐ Makeย The ๐ Go ๐' , 'myId' , 0 , 20 , dispatcher )
534
+ this . highlightRange ( '๐ Makeย The \n ๐ Go \n ๐' , 'myId' , 0 , 23 , dispatcher )
533
535
534
536
expect ( called ) . to . equal ( 1 )
535
537
} )
@@ -538,7 +540,7 @@ ke The <br> World Go Round`)
538
540
setupHighlightEnv ( this , '๐ Make The \r\n ๐ Go \n๐' )
539
541
let called = 0
540
542
const dispatcher = { notify : ( ) => called ++ }
541
- this . highlightRange ( '๐ Makeย The ๐ Go ๐' , 'myId' , 0 , 20 )
543
+ this . highlightRange ( '๐ Makeย The \n ๐ Go \n ๐' , 'myId' , 0 , 23 )
542
544
this . removeHighlight ( 'first' , dispatcher )
543
545
544
546
expect ( called ) . to . equal ( 1 )
0 commit comments