X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/530d5b117e9513fa9282015d3eb231088275c615..ecf245195f18fa05ff987a10f8e26d53ba8f36ed:/modules/documentCanvas/canvas/canvas.test3.js
diff --git a/modules/documentCanvas/canvas/canvas.test3.js b/modules/documentCanvas/canvas/canvas.test3.js
index 6e120dd..08e6e0f 100644
--- a/modules/documentCanvas/canvas/canvas.test3.js
+++ b/modules/documentCanvas/canvas/canvas.test3.js
@@ -71,6 +71,13 @@ describe('Canvas', function() {
expect(c.doc().getWlxmlTag()).to.equal('section');
});
+ describe('root element', function() {
+ it('has no parent', function() {
+ var c = canvas.fromXML('');
+ expect(c.doc().parent()).to.be.null;
+ });
+ });
+
describe('DocumentTextElement', function() {
it('can have its content set', function() {
var c = canvas.fromXML(''),
@@ -495,13 +502,13 @@ describe('Canvas', function() {
describe('unwrapping', function() {
it('unwraps DocumentTextElement from its parent DocumentNodeElement if it\'s its only child', function() {
- var c = canvas.fromXML(''),
+ var c = canvas.fromXML(''),
section = c.doc(),
- text = section.children()[0].children()[0];
+ text = section.children()[1].children()[0];
text.unwrap();
- expect(section.children().length).to.equal(1);
+ expect(section.children().length).to.equal(1, 'section has one child');
expect(section.children()[0].getText()).to.equal('Alice has a cat');
})
});