Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.

Commit c2b4314

Browse files
author
Jare Fagbemi
committed
Revert "fix(TestBed): add whitespace handling to compile"
This reverts commit 4d85bd0.
1 parent 4d85bd0 commit c2b4314

File tree

2 files changed

+1
-29
lines changed

2 files changed

+1
-29
lines changed

lib/mock/test_bed.dart

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -54,22 +54,12 @@ class TestBed {
5454
return rootElement;
5555
}
5656

57-
String _handleWhitespace(html) {
58-
return html
59-
.split('\n')
60-
.map((line) {
61-
var trimmed = line.trim();
62-
return trimmed +
63-
(trimmed.isEmpty || trimmed.endsWith('>') ? '' : ' ');
64-
})
65-
.join();
66-
}
6757
/**
6858
* Convert an [html] String to a [List] of [Element]s.
6959
*/
7060
List<Element> toNodeList(html) {
7161
var div = new DivElement();
72-
var sanitizedHtml = _handleWhitespace(html);
62+
var sanitizedHtml = html.split('\n').map((line) => line.trim()).join(' ');
7363
div.setInnerHtml(sanitizedHtml, treeSanitizer: new NullTreeSanitizer());
7464
var nodes = [];
7565
for (var node in div.nodes) {

test/mock/test_bed_spec.dart

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -27,24 +27,6 @@ void main() {
2727
expect(directiveInst.destroyed).toBe(true);
2828
});
2929

30-
it('should handle whitespace cleanly', () {
31-
var root = _.compile('''
32-
<div>
33-
<h1
34-
attr="Hi">
35-
</h1>
36-
</div>
37-
<span
38-
attr2="Bye"
39-
40-
></span>
41-
''');
42-
43-
expect(root.runtimeType).toBe(DivElement);
44-
expect(_.rootElements[1].runtimeType).toBe(SpanElement);
45-
expect(_.rootElements.length).toBe(2);
46-
});
47-
4830
});
4931
}
5032

0 commit comments

Comments
 (0)