X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/24e73bdbeb5e83ff18d2f9b359e7b41fe8230c1a..324bfe12fcbabe4da96256dd98bc16da5be3ab82:/src/smartxml/smartxml.test.js?ds=sidebyside diff --git a/src/smartxml/smartxml.test.js b/src/smartxml/smartxml.test.js index 499d1e9..6d6cbbf 100644 --- a/src/smartxml/smartxml.test.js +++ b/src/smartxml/smartxml.test.js @@ -5,6 +5,7 @@ define([ 'use strict'; /*jshint expr:true */ +/* global describe, it */ var expect = chai.expect; @@ -84,6 +85,20 @@ describe('smartxml', function() { }); + describe('Serializing document to WLXML', function() { + it('keeps document intact when no changes have been made', function() { + var xmlIn = '
Alice
has
a cat!
', + doc = getDocumentFromXML(xmlIn), + xmlOut = doc.toXML(); + + var parser = new DOMParser(), + input = parser.parseFromString(xmlIn, 'application/xml').childNodes[0], + output = parser.parseFromString(xmlOut, 'application/xml').childNodes[0]; + + expect(input.isEqualNode(output)).to.be.true; + }); + }); + }); }); \ No newline at end of file