@@ -32,7 +32,7 @@ describe('Template', () => {
3232 const out = renderer . getRenderOutput ( ) ;
3333
3434 const content = 'it works with strings' ;
35- expect ( out ) . toEqualJSX ( < div className = { undefined } dangerouslySetInnerHTML = { { __html : content } } > </ div > ) ;
35+ expect ( out ) . toEqualJSX ( < div dangerouslySetInnerHTML = { { __html : content } } > </ div > ) ;
3636 } ) ;
3737
3838 it ( 'supports templates as functions returning a string' , ( ) => {
@@ -45,7 +45,7 @@ describe('Template', () => {
4545 const out = renderer . getRenderOutput ( ) ;
4646
4747 const content = 'it also works with functions' ;
48- expect ( out ) . toEqualJSX ( < div className = { undefined } dangerouslySetInnerHTML = { { __html : content } } > </ div > ) ;
48+ expect ( out ) . toEqualJSX ( < div dangerouslySetInnerHTML = { { __html : content } } > </ div > ) ;
4949 } ) ;
5050
5151 it ( 'supports templates as functions returning a React element' , ( ) => {
@@ -58,7 +58,7 @@ describe('Template', () => {
5858 const out = renderer . getRenderOutput ( ) ;
5959
6060 const content = 'it also works with functions' ;
61- expect ( out ) . toEqualJSX ( < div className = { undefined } > < p > { content } </ p > </ div > ) ;
61+ expect ( out ) . toEqualJSX ( < div > < p > { content } </ p > </ div > ) ;
6262 } ) ;
6363
6464 it ( 'can configure compilation options' , ( ) => {
@@ -73,14 +73,11 @@ describe('Template', () => {
7373 const out = renderer . getRenderOutput ( ) ;
7474
7575 const content = 'it configures compilation delimiters' ;
76- expect ( out ) . toEqualJSX ( < div className = { undefined } dangerouslySetInnerHTML = { { __html : content } } > </ div > ) ;
76+ expect ( out ) . toEqualJSX ( < div dangerouslySetInnerHTML = { { __html : content } } > </ div > ) ;
7777 } ) ;
7878 } ) ;
7979
8080 describe ( 'using helpers' , ( ) => {
81- beforeEach ( ( ) => {
82- } ) ;
83-
8481 it ( 'call the relevant function' , ( ) => {
8582 const props = getProps ( {
8683 templates : { test : 'it supports {{#helpers.emphasis}}{{feature}}{{/helpers.emphasis}}' } ,
@@ -92,7 +89,7 @@ describe('Template', () => {
9289 const out = renderer . getRenderOutput ( ) ;
9390
9491 const content = 'it supports <em>helpers</em>' ;
95- expect ( out ) . toEqualJSX ( < div className = { undefined } dangerouslySetInnerHTML = { { __html : content } } > </ div > ) ;
92+ expect ( out ) . toEqualJSX ( < div dangerouslySetInnerHTML = { { __html : content } } > </ div > ) ;
9693 } ) ;
9794
9895 it ( 'sets the function context (`this`) to the template `data`' , done => {
@@ -130,7 +127,7 @@ describe('Template', () => {
130127
131128 const out = renderer . getRenderOutput ( ) ;
132129 const content = 'it supports transformData' ;
133- const expectedJSX = < div className = { undefined } dangerouslySetInnerHTML = { { __html : content } } > </ div > ;
130+ const expectedJSX = < div dangerouslySetInnerHTML = { { __html : content } } > </ div > ;
134131
135132 expect ( out ) . toEqualJSX ( expectedJSX ) ;
136133 } ) ;
@@ -216,21 +213,19 @@ describe('Template', () => {
216213 } ) ;
217214 } ) ;
218215
219- describe ( 'misc feature' , ( ) => {
220- it ( 'accepts props that are not defined in the proptypes' , ( ) => {
221- function fn ( ) { }
216+ it ( 'forward rootProps to the first node' , ( ) => {
217+ function fn ( ) { }
222218
223- const props = getProps ( { } ) ;
224- renderer . render ( < Template onClick = { fn } { ...props } /> ) ;
219+ const props = getProps ( { } ) ;
220+ renderer . render ( < Template rootProps = { { className : 'hey' , onClick : fn } } { ...props } /> ) ;
225221
226- const out = renderer . getRenderOutput ( ) ;
227- const expectedProps = {
228- className : undefined ,
229- dangerouslySetInnerHTML : { __html : '' } ,
230- onClick : fn
231- } ;
232- expect ( out ) . toEqualJSX ( < div { ...expectedProps } > </ div > ) ;
233- } ) ;
222+ const out = renderer . getRenderOutput ( ) ;
223+ const expectedProps = {
224+ className : 'hey' ,
225+ dangerouslySetInnerHTML : { __html : '' } ,
226+ onClick : fn
227+ } ;
228+ expect ( out ) . toEqualJSX ( < div { ...expectedProps } > </ div > ) ;
234229 } ) ;
235230
236231 context ( 'shouldComponentUpdate' , ( ) => {
0 commit comments