X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/de1034273c0aa6897014dbfb6c6c92d809fd0556..fadd66e0cc7a22d06a1d8f4ab08871fec8dafcdf:/src/smartxml/smartxml.test.js?ds=sidebyside diff --git a/src/smartxml/smartxml.test.js b/src/smartxml/smartxml.test.js index 09fdfeb..67ada78 100644 --- a/src/smartxml/smartxml.test.js +++ b/src/smartxml/smartxml.test.js @@ -262,6 +262,17 @@ describe('smartxml', function() { describe('Manipulations', function() { + it('merges adjacent text nodes resulting from detaching an element node in between', function() { + var doc = getDocumentFromXML('
Alice hasa cat
'), + span = doc.root.contents()[1]; + + span.detach(); + + var rootContents = doc.root.contents(); + expect(rootContents).to.have.length(1, 'one child left'); + expect(rootContents[0].getText()).to.equal('Alice a cat'); + }); + it('appends element node to another element node', function() { var node1 = elementNodeFromParams({tag: 'div'}), node2 = elementNodeFromParams({tag: 'a'}),