editor: fix selecting text spanning multiple nodes in Chrome
[fnpeditor.git] / src / smartxml / smartxml.test.js
index 491c586..cc2b3cf 100644 (file)
@@ -1632,6 +1632,24 @@ describe('smartxml', function() {
                 expect(doc.root.getAttr('smart')).to.equal('1');
                 expect(doc.root.getAttr('unaware')).to.equal('1');
             });
+
+            it('can have associated metadata', function() {
+                var doc = getDocumentFromXML('<div></div>'),
+                    metadata = Object.create({});
+
+                doc.registerExtension({document: {transformations: {
+                    test: function() {
+                        this.trigger('change');
+                    }
+                }}});
+
+                doc.startTransaction(metadata);
+                doc.test();
+                doc.endTransaction();
+
+                var transaction = doc.undoStack[0];
+                expect(transaction.metadata).to.equal(metadata);
+            });
         });
 
         describe('Regression tests', function() {