Skip to content

Commit ca878f0

Browse files
ajwildmarcbachmann
authored andcommitted
chore: Fix failing test related to rangy normalizeBoundaries
1 parent f36eaaf commit ca878f0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

spec/selection.spec.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,11 +489,13 @@ describe('Selection', function () {
489489
const selection = new Selection(this.wordWithWhitespace, range)
490490
selection.save()
491491
selection.restore()
492+
// With rangy normalizeBoundaries the nodes are merged together again
493+
expect(this.wordWithWhitespace.childNodes.length).to.equal(1)
492494

493495
// Select specific characters within nodes across multiple nodes
494496
const rangeTwo = rangy.createRange()
495497
rangeTwo.setStart(this.wordWithWhitespace, 0) // Select first node (start)
496-
rangeTwo.setEnd(this.wordWithWhitespace.childNodes[2], 2) // Select middle of last node
498+
rangeTwo.setEnd(this.wordWithWhitespace.firstChild, 6) // Select middle of the string
497499
const selectionTwo = new Selection(this.wordWithWhitespace, rangeTwo)
498500
selectionTwo.makeBold()
499501

0 commit comments

Comments
 (0)