X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/9e4ef8a51fbe1e5df22334bc63276f9ffbaade73..b4f3f9be95d6b0a454e18389bb0903e0cd63ae53:/src/smartxml/smartxml.test.js diff --git a/src/smartxml/smartxml.test.js b/src/smartxml/smartxml.test.js index cbef963..7b42580 100644 --- a/src/smartxml/smartxml.test.js +++ b/src/smartxml/smartxml.test.js @@ -1592,6 +1592,34 @@ describe('smartxml', function() { expect(doc.root.getAttr('unaware')).to.equal('1'); }); }); + + describe('Regression tests', function() { + it('redos correctly after running its own undo followed by unaware transformation undo', function() { + var doc = getDocumentFromXML('
'); + + doc.registerExtension({elementNode: {transformations: { + unaware: function() { + this.triggerChangeEvent(); + }, + test: { + impl: function() { + this._$.attr('t', 1); + this.triggerChangeEvent(); + }, + undo: function() { + this._$.attr('t', 0); + } + } + }}}); + doc.root.unaware(); + doc.root.test(); + doc.undo(); + doc.undo(); + doc.redo(); + doc.redo(); + expect(doc.root.getAttr('t')).to.equal('1'); + }); + }); }); });