Skip to content

Commit 51325a6

Browse files
marcbachmannpeyerluk
authored andcommitted
test: Normalize element after applying selection operations to ensure tests are consistent
1 parent e4dd5e8 commit 51325a6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

spec/selection.spec.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,8 @@ describe('Selection', function () {
348348
let selection = new Selection(this.oneWord, range)
349349
// link foo
350350
selection.link('https://livingdocs.io')
351+
this.oneWord.normalize()
352+
351353
// select 1 char more to the right (b)
352354
range = createRange()
353355
// Note: we need to use firstChild twice to get the textNode inside the a tag which is
@@ -370,7 +372,8 @@ describe('Selection', function () {
370372
let selection = new Selection(this.oneWord, range)
371373
// link bar
372374
selection.link('https://livingdocs.io')
373-
console.log(getHtml(this.oneWord))
375+
this.oneWord.normalize()
376+
374377
// select 1 char more to the left (o)
375378
range = createRange()
376379
range.setStart(this.oneWord.firstChild, 2)

0 commit comments

Comments
 (0)