X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/7dc3d4d5e031615e4dd5393fe126daa7248ce184..4442dc983215c50244bfc43bec26b6d7d9806dbe:/modules/documentCanvas/canvas/canvas.test3.js?ds=inline diff --git a/modules/documentCanvas/canvas/canvas.test3.js b/modules/documentCanvas/canvas/canvas.test3.js index 0d8e87a..9aab247 100644 --- a/modules/documentCanvas/canvas/canvas.test3.js +++ b/modules/documentCanvas/canvas/canvas.test3.js @@ -107,6 +107,22 @@ describe('Canvas', function() { expect(section.getWlxmlClass()).to.be.undefined; }); }); + + it('returns DocumentNodeElement instance from HTMLElement', function() { + var c = canvas.fromXML('
'), + htmlElement = c.doc().dom().get(0), + element = c.getDocumentElement(htmlElement); + expect(element).to.be.instanceOf(documentElement.DocumentNodeElement); + expect(element.sameNode(c.doc())); + }); + + it('returns DocumentTextElement instance from Text Node', function() { + var c = canvas.fromXML('
Alice
'), + textNode = c.doc().children(0)[0].dom().get(0), + element = c.getDocumentElement(textNode); + expect(element).to.be.instanceOf(documentElement.DocumentTextElement); + expect(element.sameNode(c.doc().children()[0])); + }); });