X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/e0aad96df245c7148966887cbcc77417a4b7675b..34c9285ef29074d0c13cea81fbb05e93eb369b4a:/src/editor/modules/documentCanvas/canvas/canvas.test.js?ds=sidebyside
diff --git a/src/editor/modules/documentCanvas/canvas/canvas.test.js b/src/editor/modules/documentCanvas/canvas/canvas.test.js
index 9059e3f..f64754f 100644
--- a/src/editor/modules/documentCanvas/canvas/canvas.test.js
+++ b/src/editor/modules/documentCanvas/canvas/canvas.test.js
@@ -4,8 +4,9 @@ define([
'libs/sinon',
'modules/documentCanvas/canvas/canvas',
'modules/documentCanvas/canvas/utils',
+'modules/documentCanvas/canvas/documentElement',
'wlxml/wlxml',
-], function($, chai, sinon, canvas, utils, wlxml) {
+], function($, chai, sinon, canvas, utils, documentElement, wlxml) {
'use strict';
/* global describe, it, beforeEach, afterEach */
@@ -124,7 +125,7 @@ describe('Listening to document changes', function() {
aTextElement;
canvas.fromXMLDocument(doc);
- aTextElement = utils.findCanvasElementInParent(aTextNode, aTextNode.parent()); // TODO: This really should be easier...
+ aTextElement = utils.getElementForNode(aTextNode);
aTextElement.setText('');
@@ -219,6 +220,24 @@ describe('Default document changes handling', function() {
expect(sectionChildren[1].wlxmlNode.getTagName()).to.equal('a');
});
+ it('handles moving text node to another parent', function() {
+ var c = getCanvasFromXML('