X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/0f5cbf957bc0bbdcff93bdb33c227f78041e332b..7a67ffc356936a4eec4243df03fab2ad1c66c9b9:/src/smartxml/smartxml.test.js diff --git a/src/smartxml/smartxml.test.js b/src/smartxml/smartxml.test.js index a15f833..11118f4 100644 --- a/src/smartxml/smartxml.test.js +++ b/src/smartxml/smartxml.test.js @@ -843,7 +843,7 @@ describe('smartxml', function() { textNode.transform('testTransformation'); }).to.throw(Error); expect(function() { - doc.transform('testTransformation'); + doc.testTransformation(); }).to.throw(Error); expect(doc.testMethod).to.be.undefined; expect(elementNode.testMethod).to.be.undefined; @@ -866,8 +866,8 @@ describe('smartxml', function() { }}}; doc.registerExtension(extension); - expect(doc.transform('testTransformation')).to.equal(doc, 'context is set to a document instance'); - expect(doc.transform('testTransformation2')).to.equal(doc, 'context is set to a document instance'); + expect(doc.testTransformation()).to.equal(doc, 'context is set to a document instance'); + expect(doc.testTransformation2()).to.equal(doc, 'context is set to a document instance'); }); it('allows adding method to a DocumentNode instance', function() { @@ -893,10 +893,14 @@ describe('smartxml', function() { doc.registerExtension(extension); - expect(elementNode.transform('testTransformation').sameNode(elementNode)).to.equal(true, '1'); - expect(elementNode.transform('testTransformation2').sameNode(elementNode)).to.equal(true, '2'); - expect(textNode.transform('testTransformation').sameNode(textNode)).to.equal(true, '3'); - expect(textNode.transform('testTransformation2').sameNode(textNode)).to.equal(true, '4'); + /* refresh */ + elementNode = doc.root; + textNode = doc.root.contents()[0]; + + expect(elementNode.testTransformation().sameNode(elementNode)).to.equal(true, '1'); + expect(elementNode.testTransformation2().sameNode(elementNode)).to.equal(true, '2'); + expect(textNode.testTransformation().sameNode(textNode)).to.equal(true, '3'); + expect(textNode.testTransformation2().sameNode(textNode)).to.equal(true, '4'); }); });