mithril-node-render
Advanced tools
Comparing version 1.0.1-3 to 1.0.1-4
@@ -160,2 +160,3 @@ 'use strict' | ||
state: copy(component), | ||
children: copy(view.children), | ||
attrs: view.attrs || {} | ||
@@ -167,2 +168,3 @@ } | ||
state: copy(component), | ||
children: copy(view.children), | ||
attrs: options.attrs || {} | ||
@@ -180,2 +182,3 @@ } | ||
state: copy(view.tag), | ||
children: copy(view.children), | ||
attrs: view.attrs | ||
@@ -182,0 +185,0 @@ } |
{ | ||
"name": "mithril-node-render", | ||
"version": "1.0.1-3", | ||
"version": "1.0.1-4", | ||
"description": "Node rending of mithril views", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
17
test.js
@@ -90,2 +90,19 @@ 'use strict' | ||
}) | ||
o('with children', function() { | ||
var parentComponent = { | ||
view: function(node) { | ||
return m('div', node.children) | ||
} | ||
} | ||
o(render(m(parentComponent, 'howdy'))).equals('<div>howdy</div>') | ||
o(render(m(parentComponent, m('span', 'howdy')))).equals('<div><span>howdy</span></div>') | ||
o(render(m(parentComponent, [ | ||
m('span', 'foo'), | ||
m('span', 'bar') | ||
]))).equals('<div><span>foo</span><span>bar</span></div>') | ||
o(render(m(parentComponent, m.trust('<span>trust me</span>')))).equals('<div><span>trust me</span></div>') | ||
o(render(m(parentComponent, m(myComponent, { foo: 'foz' })))).equals('<div><div>hellobarfoz</div></div>') | ||
}) | ||
}) | ||
@@ -92,0 +109,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
19023
432