X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/2613031b220940f47a67d3536b5cc5581fbf155a..b31ffcb46eae55b9c66457e2330b16e8db84f1d6:/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() {