X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/c36df0c30a4fb6398823ab4b903054675953aba2..e5b71883b5c32bd8ad797eeea9da2c7eaa5b741e:/src/smartxml/smartxml.test.js diff --git a/src/smartxml/smartxml.test.js b/src/smartxml/smartxml.test.js index d82f823..cc68cdd 100644 --- a/src/smartxml/smartxml.test.js +++ b/src/smartxml/smartxml.test.js @@ -60,6 +60,15 @@ describe('smartxml', function() { expect(emptyTextNode.getText()).to.equal('', 'empty ok'); expect(nonEmptyTextNode.getText()).to.equal('alice', 'non empty ok'); }); + + it('creates nodes from xml strings', function() { + var doc = getDocumentFromXML('
'), + node = doc.createDocumentNode('Alice'); + expect(node.getTagName()).to.equal('a'); + expect(node.contents().length).to.equal(2); + expect(node.contents()[0].getText()).to.equal('Alice'); + expect(node.contents()[1].getTagName()).to.equal('b'); + }); }); describe('DocumentNode', function() {