smartxml: DocumentElement.parents
[fnpeditor.git] / src / smartxml / smartxml.test.js
index df35a37..00c3ee9 100644 (file)
@@ -496,6 +496,15 @@ describe('smartxml', function() {
                 expect(a.parent()).to.equal(null, 'parent of a root is null');
                 expect(b.parent().sameNode(a)).to.be.true;
             });
+            it('can access node parents', function() {
+                var doc = getDocumentFromXML('<a><b><c></c></b></a>'),
+                    a = doc.root,
+                    b = a.contents()[0],
+                    c = b.contents()[0];
+
+                var parents = c.parents();
+                expect(parents).to.eql([b,a]);
+            });
         });
     });