doc = getDocumentFromXML('<section>Alice<div class="test_class"></div></section>');
elementNode = doc.root;
textNode = doc.root.contents()[0];
+ testClassNode = doc.root.contents('.test_class');
extension = {};
+ expect(testClassNode.object).to.be.undefined;
- // spr+ a expect dotyczacy object api?
});
it('allows adding method to an ElementNode of specific class', function() {
}}}};
doc.registerExtension(extension);
testClassNode = doc.root.contents()[1];
- expect(testClassNode.object.transform('testTransformation').sameNode(testClassNode)).to.equal(true, '1');
- expect(testClassNode.object.transform('testTransformation2').sameNode(testClassNode)).to.equal(true, '1');
+ expect(testClassNode.object.testTransformation().sameNode(testClassNode)).to.equal(true, '1');
+ expect(testClassNode.object.testTransformation2().sameNode(testClassNode)).to.equal(true, '1');
});