X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/988d47428991ee70383755b5b4f6d337d3049fee..f0599fd59924ae14e4f4e291553be88bae3f1fa0:/modules/documentCanvas/canvas/canvas.test3.js diff --git a/modules/documentCanvas/canvas/canvas.test3.js b/modules/documentCanvas/canvas/canvas.test3.js index ff7c5c4..ba14af7 100644 --- a/modules/documentCanvas/canvas/canvas.test3.js +++ b/modules/documentCanvas/canvas/canvas.test3.js @@ -426,6 +426,19 @@ describe('Canvas', function() { expect(wrapperChildren[2].getText()).to.equal(' cat'); }); }); + + describe('unwrapping', function() { + it('unwraps DocumentTextElement from its parent DocumentNodeElement if it\'s its only child', function() { + var c = canvas.fromXML('
Alice has a cat
'), + section = c.doc(), + text = section.children()[0].children()[0]; + + text.unwrap(); + + expect(section.children().length).to.equal(1); + expect(section.children()[0].getText()).to.equal('Alice has a cat'); + }) + }); }); describe('Lists api', function() {