@@ -9,16 +9,6 @@ describe('Template Parser', function () {
99 expect ( res ) . toBe ( frag )
1010 } )
1111
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-
2212 it ( 'should parse if argument is a template string' , function ( ) {
2313 var res = parse ( testString )
2414 expect ( res . nodeType ) . toBe ( 11 )
@@ -50,6 +40,15 @@ describe('Template Parser', function () {
5040 expect ( res . firstChild . nodeValue ) . toBe ( '' )
5141 } )
5242
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+
5352 it ( 'should parse textContent if argument is a script node' , function ( ) {
5453 var node = document . createElement ( 'script' )
5554 node . textContent = testString
0 commit comments