|
@@ -158,7 +158,7 @@ describe('Template Parser', function () {
|
|
|
expect(c.value).toBe('')
|
|
expect(c.value).toBe('')
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
- it('should trim empty text nodes', function () {
|
|
|
|
|
|
|
+ it('should trim empty text nodes and comments', function () {
|
|
|
// string
|
|
// string
|
|
|
var res = parse(' <p>test</p> ')
|
|
var res = parse(' <p>test</p> ')
|
|
|
expect(res.childNodes.length).toBe(1)
|
|
expect(res.childNodes.length).toBe(1)
|
|
@@ -169,6 +169,10 @@ describe('Template Parser', function () {
|
|
|
res = parse(el.children[0])
|
|
res = parse(el.children[0])
|
|
|
expect(res.childNodes.length).toBe(1)
|
|
expect(res.childNodes.length).toBe(1)
|
|
|
expect(res.firstChild.tagName).toBe('P')
|
|
expect(res.firstChild.tagName).toBe('P')
|
|
|
|
|
+ // comments
|
|
|
|
|
+ res = parse(' <!-- yo --> <p>test</p> <!-- yo --> ')
|
|
|
|
|
+ expect(res.childNodes.length).toBe(1)
|
|
|
|
|
+ expect(res.firstChild.tagName).toBe('P')
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
it('should reuse fragment from cache for the same string template', function () {
|
|
it('should reuse fragment from cache for the same string template', function () {
|