From ca878f0f32cf4eaf0ebd53f2467973e5c59e8b97 Mon Sep 17 00:00:00 2001 From: Alex Wild Date: Fri, 8 Dec 2023 10:59:24 +0100 Subject: [PATCH] chore: Fix failing test related to rangy normalizeBoundaries --- spec/selection.spec.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spec/selection.spec.js b/spec/selection.spec.js index 0f8458ae..c53a150b 100644 --- a/spec/selection.spec.js +++ b/spec/selection.spec.js @@ -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()