X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/179b145075f8f90038cba27e30a4fcadd3a764ff..25e14ce74de1ecdd95f36cb19e231b5a66898038:/modules/documentCanvas/canvas/canvas.test3.js 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() {