Skip to content

Commit

Permalink
chore: Fix failing test related to rangy normalizeBoundaries
Browse files Browse the repository at this point in the history
  • Loading branch information
ajwild authored and marcbachmann committed Jan 10, 2024
1 parent f36eaaf commit ca878f0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion spec/selection.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -489,11 +489,13 @@ describe('Selection', function () {
const selection = new Selection(this.wordWithWhitespace, range)
selection.save()
selection.restore()
// With rangy normalizeBoundaries the nodes are merged together again
expect(this.wordWithWhitespace.childNodes.length).to.equal(1)

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

Expand Down

0 comments on commit ca878f0

Please sign in to comment.