smartxml: Integrating old tests from canvas api (keeping entities)
authorAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Wed, 23 Oct 2013 11:54:37 +0000 (13:54 +0200)
committerAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Wed, 23 Oct 2013 11:54:37 +0000 (13:54 +0200)
src/smartxml/smartxml.test.js

index 597c107..86f16de 100644 (file)
@@ -176,6 +176,19 @@ describe('smartxml', function() {
             
             expect(input.isEqualNode(output)).to.be.true;
         });
+
+        it('keeps entities intact', function() {
+            var xmlIn = '<section>&lt; &gt;</section>',
+                doc = getDocumentFromXML(xmlIn),
+                xmlOut = doc.toXML();
+            expect(xmlOut).to.equal(xmlIn);
+        });
+        it('keeps entities intact when they form html/xml', function() {
+            var xmlIn = '<section>&lt;abc&gt;</section>',
+                doc = getDocumentFromXML(xmlIn),
+                xmlOut = doc.toXML();
+            expect(xmlOut).to.equal(xmlIn);
+        });
     });
 
 });