X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/27aad148fb13a6705a8fd91ea693bd8ea46da396..b2ed6c0477904d9bcbf8494043f231a5197f6b78:/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() {