X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/7dc3d4d5e031615e4dd5393fe126daa7248ce184..12255fb81ee2d3b63e238a595e4813520650cd01:/modules/documentCanvas/canvas/canvas.test3.js
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(''),
+ 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]));
+ });
});