Skip to content

Commit faeb13d

Browse files
committed
fix: test to check that highlight does not break when text comment is deleted
1 parent 2204337 commit faeb13d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

spec/highlighting.spec.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,11 @@ ke The <br> World Go Round`)
382382
expect(highlightSpan.length).to.equal(0)
383383
})
384384

385+
it('does not throw when text has been deleted', function () {
386+
setupHighlightEnv(this, '')
387+
expect(() => this.highlightRange('not found', 'myId', 33, 38)).to.not.throw()
388+
})
389+
385390
it('normalizes a simple text node after removing a highlight', function () {
386391
setupHighlightEnv(this, 'People Make The World Go Round')
387392
this.highlightRange('ple ', 'myId', 3, 7)
@@ -670,7 +675,5 @@ Make The&nbsp;<br>&nbsp;W<span class="highlight-spellcheck" data-word-id="spellc
670675
expect(this.getHtml()).to.equal(expectedHtml)
671676
expect(this.extractWithoutNativeRange('comment')).to.deep.equal(expectedRanges)
672677
})
673-
674-
675678
})
676679
})

0 commit comments

Comments
 (0)