4 ], function(chai, wlxml) {
8 var expect = chai.expect;
10 var nodeFromXML = function(xml) {
11 return wlxml.WLXMLElementNodeFromXML(xml);
15 describe('WLXMLDocument', function() {
17 describe('Basic wlxml element node properties', function() {
18 it('returns its class', function() {
19 var node = nodeFromXML('<header class="class.subclass"></header>');
20 expect(node.getClass()).to.equal('class.subclass');
23 it('returns its attributes as dict', function() {
24 var node = nodeFromXML('<span meta-attr1="val1" meta-attr2="val2"></span>');
25 expect(node.getMetaAttributes()).to.eql({attr1: 'val1', attr2: 'val2'});
28 it('returns attributes other than class and meta-* as other attributes', function() {
29 var node = nodeFromXML('<span class="uri" meta-attr="val" attr1="val1" attr2="val2"></span>');
30 expect(node.getOtherAttributes()).to.eql({attr1: 'val1', attr2: 'val2'});