X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/0487914c40881829a526a7a09b6d545f08aa28e7..a4e2af35996896240356ad8ca4c7b6003d4b9ff3:/src/wlxml/wlxml.test.js diff --git a/src/wlxml/wlxml.test.js b/src/wlxml/wlxml.test.js index 95c230f..090cd56 100644 --- a/src/wlxml/wlxml.test.js +++ b/src/wlxml/wlxml.test.js @@ -7,12 +7,30 @@ define([ var expect = chai.expect; +var nodeFromXML = function(xml) { + return wlxml.WLXMLElementNodeFromXML(xml); +}; -describe('how it works', function() { - it('does something', function() { - var doc = wlxml.WLXMLDocumentFromXML('
'); - expect(doc.root.getClass()).to.equal('class.subclass'); + +describe('WLXMLDocument', function() { + + describe('Basic wlxml element node properties', function() { + it('returns its class', function() { + var node = nodeFromXML('
'); + expect(node.getClass()).to.equal('class.subclass'); + }); + + it('returns its attributes as dict', function() { + var node = nodeFromXML(''); + expect(node.getMetaAttributes()).to.eql({attr1: 'val1', attr2: 'val2'}); + }); + + it('returns attributes other than class and meta-* as other attributes', function() { + var node = nodeFromXML(''); + expect(node.getOtherAttributes()).to.eql({attr1: 'val1', attr2: 'val2'}); + }); }); + }); }); \ No newline at end of file