X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/e1fef8a5849274a64f2c75ea4c7a261d67cea1a3..d61535cf50c7a8cb597db7f1d9681901a06efaa5:/src/smartxml/smartxml.test.js diff --git a/src/smartxml/smartxml.test.js b/src/smartxml/smartxml.test.js index e58e754..86f16de 100644 --- a/src/smartxml/smartxml.test.js +++ b/src/smartxml/smartxml.test.js @@ -111,6 +111,12 @@ describe('smartxml', function() { doc.root.setTag('span'); expect(doc.root.getTagName()).to.equal('span'); }); + + it('keeps contents', function() { + var node = elementNodeFromXML('
'); + node.setTag('header'); + expect(node.contents()).to.have.length(1); + }); }); @@ -170,6 +176,19 @@ describe('smartxml', function() { expect(input.isEqualNode(output)).to.be.true; }); + + it('keeps entities intact', function() { + var xmlIn = '
< >
', + doc = getDocumentFromXML(xmlIn), + xmlOut = doc.toXML(); + expect(xmlOut).to.equal(xmlIn); + }); + it('keeps entities intact when they form html/xml', function() { + var xmlIn = '
<abc>
', + doc = getDocumentFromXML(xmlIn), + xmlOut = doc.toXML(); + expect(xmlOut).to.equal(xmlIn); + }); }); });