X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/058eee1d91537d6b060be9f5eb5433287e7303fc..9fc9629a92ebc396c5f3f3cbe3dc8a7acc53f9c3:/modules/documentCanvas/canvas/canvas.test3.js?ds=sidebyside diff --git a/modules/documentCanvas/canvas/canvas.test3.js b/modules/documentCanvas/canvas/canvas.test3.js index 4a7c661..0ffa9d9 100644 --- a/modules/documentCanvas/canvas/canvas.test3.js +++ b/modules/documentCanvas/canvas/canvas.test3.js @@ -132,6 +132,27 @@ describe('Canvas', function() { expect(children[idx]).to.be.instanceOf(documentElement.DocumentNodeElement); }); }); + + it('trims white space from the beginning and the end of the block elements', function() { + var c = canvas.fromXML('
Alice has a cat
'); + expect(c.doc().children()[0].getText()).to.equal('Alice '); + expect(c.doc().children()[2].getText()).to.equal(' a cat'); + }); + + it('normalizes string of white characters to one space at the inline element boundries', function() { + var c = canvas.fromXML(' Alice has a cat '); + expect(c.doc().children()[0].getText()).to.equal(' Alice has a cat '); + }); + + it('normalizes string of white characters to one space before inline element', function() { + var c = canvas.fromXML('
Alice has a cat
'); + expect(c.doc().children()[0].getText()).to.equal('Alice has '); + }); + + it('normalizes string of white characters to one space after inline element', function() { + var c = canvas.fromXML('
Alice has a cat
'); + expect(c.doc().children()[2].getText()).to.equal(' cat'); + }); }); });