@@ -9,16 +9,6 @@ describe('Template Parser', function () {
9
9
expect ( res ) . toBe ( frag )
10
10
} )
11
11
12
- it ( 'should return content if argument is a valid template node' , function ( ) {
13
- var templateNode = document . createElement ( 'template' )
14
- if ( ! templateNode . content ) {
15
- // mock the content
16
- templateNode . content = document . createDocumentFragment ( )
17
- }
18
- var res = parse ( templateNode )
19
- expect ( res ) . toBe ( templateNode . content )
20
- } )
21
-
22
12
it ( 'should parse if argument is a template string' , function ( ) {
23
13
var res = parse ( testString )
24
14
expect ( res . nodeType ) . toBe ( 11 )
@@ -50,6 +40,15 @@ describe('Template Parser', function () {
50
40
expect ( res . firstChild . nodeValue ) . toBe ( '' )
51
41
} )
52
42
43
+ it ( 'should parse innerHTML if argument is a template node' , function ( ) {
44
+ var templateNode = document . createElement ( 'template' )
45
+ templateNode . innerHTML = testString
46
+ var res = parse ( templateNode )
47
+ expect ( res . nodeType ) . toBe ( 11 )
48
+ expect ( res . childNodes . length ) . toBe ( 2 )
49
+ expect ( res . querySelector ( '.test' ) . textContent ) . toBe ( 'world' )
50
+ } )
51
+
53
52
it ( 'should parse textContent if argument is a script node' , function ( ) {
54
53
var node = document . createElement ( 'script' )
55
54
node . textContent = testString
0 commit comments