X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/b18fdf0bf367567d1171c14438c03ac39fad3f6b..c654f07dd8b596abc328f1f57beef06bffa63149:/src/editor/modules/documentCanvas/canvas/canvas.test.js diff --git a/src/editor/modules/documentCanvas/canvas/canvas.test.js b/src/editor/modules/documentCanvas/canvas/canvas.test.js index 0654170..be4a8b9 100644 --- a/src/editor/modules/documentCanvas/canvas/canvas.test.js +++ b/src/editor/modules/documentCanvas/canvas/canvas.test.js @@ -293,7 +293,11 @@ describe('Custom elements based on wlxml class attribute', function() { onNodeAdded: function(event) { void(event); this.refresh2(); - } + }, + onNodeTextChange: function(event) { + this.header.text(event.meta.node.getText()); + }, + children: function() { return []; } }); var c = getCanvasFromXML('
', [ @@ -309,6 +313,14 @@ describe('Custom elements based on wlxml class attribute', function() { node.append({tagName: 'div'}); expect(header.text()).to.equal('2', 'added div'); + + var textNode = node.append({text: 'test'}); + + expect(header.text()).to.equal('3', 'added text node'); + + textNode.setText('test2'); + + expect(header.text()).to.equal('test2', 'text node change handled'); }); describe('Handling unknown class', function() {