You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
describe('should format textarea html for readability',function(){
15
+
it('adding newlines after immediate child tags',function(){
16
+
$rootScope.html='<p>Test Line 1</p><div>Test Line 2</div><span>Test Line 3</span>';
17
+
$rootScope.$digest();
18
+
expect(element.val()).toBe('<p>Test Line 1</p>\n<div>Test Line 2</div>\n<span>Test Line 3</span>');
19
+
});
20
+
it('ignore nested tags',function(){
21
+
$rootScope.html='<p><b>Test</b> Line 1</p><div>Test <i>Line</i> 2</div><span>Test Line <u>3</u></span>';
22
+
$rootScope.$digest();
23
+
expect(element.val()).toBe('<p><b>Test</b> Line 1</p>\n<div>Test <i>Line</i> 2</div>\n<span>Test Line <u>3</u></span>');
24
+
});
25
+
it('tab out li elements',function(){
26
+
$rootScope.html='<ul><li>Test Line 1</li><li>Test Line 2</li><li>Test Line 3</li></ul>';
27
+
$rootScope.$digest();
28
+
expect(element.val()).toBe('<ul>\n\t<li>Test Line 1</li>\n\t<li>Test Line 2</li>\n\t<li>Test Line 3</li>\n</ul>');
29
+
});
30
+
it('handle nested lists',function(){
31
+
$rootScope.html='<ol><li>Test Line 1</li><ul><li>Nested Line 1</li><li>Nested Line 2</li></ul><li>Test Line 3</li></ol>';
32
+
$rootScope.$digest();
33
+
expect(element.val()).toBe('<ol>\n\t<li>Test Line 1</li>\n\t<ul>\n\t\t<li>Nested Line 1</li>\n\t\t<li>Nested Line 2</li>\n\t</ul>\n\t<li>Test Line 3</li>\n</ol>');
0 commit comments