getClass: function() {
return this.getAttr('class') || '';
},
+ getClassHierarchy: function() {
+ return getClassLists(this.getClass());
+ },
setClass: function(klass) {
if(klass !== this.klass) {
installObject(this, klass);
return this.WLXMLDocumentFromXML(xml).root;
},
- WLXMLDocument: WLXMLDocument
+ WLXMLDocument: WLXMLDocument,
+ getClassHierarchy: getClassLists
};
});
\ No newline at end of file
expect(node.getClass()).to.equal('class.subclass');
});
+ it('returns its class hierarchy', function() {
+ var node = nodeFromXML('<div class="a.b.c"></div>');
+ expect(node.getClassHierarchy()).to.eql(['', 'a', 'a.b', 'a.b.c']);
+ });
+
it('returns unregistered attributes', function() {
var testClasses = {
'testClass': {