+describe('Handling empty text nodes', function() {
+ it('puts zero width space into node with about to be remove text', function(done) {
+ var c = getCanvasFromXML('<section>Alice</section>'),
+ textElement = c.doc().children()[0];
+ textElement.setText('');
+
+ /* Wait for MutationObserver to kick in. */
+ wait(function() {
+ expect(textElement.getText({raw:true})).to.equal(utils.unicode.ZWS, 'ZWS in canvas');
+ expect(c.wlxmlDocument.root.contents()[0].getText()).to.equal('', 'empty string in a document');
+ done();
+ });
+ });
+});
+