'use strict';
/* jshint expr:true */
-/* global it, describe */
+/* global it, describe, beforeEach */
var expect = chai.expect;
});
describe('White space handling', function() {
+ /* globals Node */
+
it('ignores white space surrounding block elements', function() {
var node = nodeFromXML('<section> <div></div> </section>'),
contents = node.contents();
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');
});