X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/27aad148fb13a6705a8fd91ea693bd8ea46da396..b5fab6c09bccfcdd09ed63f6fddfab6486d1d919:/modules/documentCanvas/canvas/canvas.test3.js?ds=sidebyside diff --git a/modules/documentCanvas/canvas/canvas.test3.js b/modules/documentCanvas/canvas/canvas.test3.js index 10f8348..0fe89cc 100644 --- a/modules/documentCanvas/canvas/canvas.test3.js +++ b/modules/documentCanvas/canvas/canvas.test3.js @@ -458,6 +458,22 @@ describe('Canvas', function() { }); }); + describe('Removing elements', function() { + it('merges left and right DocumentTextElement sibling of a detached DocumentNodeElement', function() { + var c = canvas.fromXML('
Alice
has
a cat
'), + section = c.doc(), + div = section.children()[1]; + + div.detach(); + + var sectionChildren = section.children(), + textElement = sectionChildren[0]; + + expect(sectionChildren).to.have.length(1); + expect(textElement.getText()).to.equal('Alicea cat'); + }); + }); + describe('Splitting text', function() { it('splits DocumentTextElement\'s parent into two DocumentNodeElements of the same type', function() {