X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/25e14ce74de1ecdd95f36cb19e231b5a66898038..c62820ef529ff40e46d30aedff2ba870e8e18395:/modules/documentCanvas/canvas/canvas.test3.js?ds=inline diff --git a/modules/documentCanvas/canvas/canvas.test3.js b/modules/documentCanvas/canvas/canvas.test3.js index 0fe89cc..6a87d95 100644 --- a/modules/documentCanvas/canvas/canvas.test3.js +++ b/modules/documentCanvas/canvas/canvas.test3.js @@ -732,6 +732,19 @@ describe('Canvas', function() { expect(section.children()[0].getText()).to.equal('Alice has a cat'); expect(newTextContainer.sameNode(c.doc())).to.equal(true, 'unwrap returns new text parent DocumentNodeElement'); }); + + it('unwraps text element from its parent - first child case', function() { + var c = canvas.fromXML('
Sometext
'), + section = c.doc(), + span = section.children()[0]; + + span.children()[0].unwrap(); + + var sectionChildren = section.children(); + + expect(sectionChildren).to.have.length(1); + expect(sectionChildren[0].getText()).to.equal('Sometext'); + }); }); });