Fixing breaking node into two
[fnpeditor.git] / modules / documentCanvas / tests / utils.test.js
1 define(['libs/chai', './utils.js'], function(chai, utils) {\r
2 \r
3 'use strict';\r
4 var assert = chai.assert;\r
5 \r
6 test('open+open', function() {\r
7     assert.equal(utils.cleanUp('<div class="class"> \n <div class="class"></div></div>'), '<div class="class"><div class="class"></div></div>');\r
8 })\r
9 \r
10 test('close+close', function() {\r
11     assert.equal(utils.cleanUp('<div><div></div>\n </div>'), '<div><div></div></div>');\r
12 })\r
13 \r
14 test('close+open', function() {\r
15     assert.equal(utils.cleanUp('<div></div>\n <div class="class"></div>'), '<div></div><div class="class"></div>');\r
16 })\r
17 \r
18 test('bug', function() {\r
19     var txt = '\\r
20                 <section> \\r
21                     <header class="some.class">Head</header>\\r
22                     <header class="some.class">er 1</header>\\r
23                 </section>'\r
24     var txt2 = '<section><header class="some.class">Head</header><header class="some.class">er 1</header></section>';\r
25     assert.equal(utils.cleanUp(txt), txt2); \r
26 });\r
27 \r
28 \r
29 });