add test for textnode->element and element->textnode
This commit is contained in:
parent
b972607c8d
commit
3eb4bfc6a6
3 changed files with 28 additions and 0 deletions
|
|
@ -720,6 +720,20 @@ function testMithril(mock) {
|
|||
m.render(root, m("#foo", [m("div"), m("#bar")]))
|
||||
return root.childNodes[0].childNodes[0].nodeName === "DIV"
|
||||
})
|
||||
test(function() {
|
||||
//https://github.com/lhorie/mithril.js/issues/44
|
||||
var root = mock.document.createElement("div")
|
||||
m.render(root, m("#foo", ["test", m("#bar")]))
|
||||
m.render(root, m("#foo", [m("div"), m("#bar")]))
|
||||
return root.childNodes[0].childNodes[0].nodeName === "DIV"
|
||||
})
|
||||
test(function() {
|
||||
//https://github.com/lhorie/mithril.js/issues/44
|
||||
var root = mock.document.createElement("div")
|
||||
m.render(root, m("#foo", [m("div"), m("#bar")]))
|
||||
m.render(root, m("#foo", ["test", m("#bar")]))
|
||||
return root.childNodes[0].childNodes[0].nodeValue === "test"
|
||||
})
|
||||
|
||||
//m.redraw
|
||||
test(function() {
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -182,6 +182,20 @@ function testMithril(mock) {
|
|||
m.render(root, m("#foo", [m("div"), m("#bar")]))
|
||||
return root.childNodes[0].childNodes[0].nodeName === "DIV"
|
||||
})
|
||||
test(function() {
|
||||
//https://github.com/lhorie/mithril.js/issues/44
|
||||
var root = mock.document.createElement("div")
|
||||
m.render(root, m("#foo", ["test", m("#bar")]))
|
||||
m.render(root, m("#foo", [m("div"), m("#bar")]))
|
||||
return root.childNodes[0].childNodes[0].nodeName === "DIV"
|
||||
})
|
||||
test(function() {
|
||||
//https://github.com/lhorie/mithril.js/issues/44
|
||||
var root = mock.document.createElement("div")
|
||||
m.render(root, m("#foo", [m("div"), m("#bar")]))
|
||||
m.render(root, m("#foo", ["test", m("#bar")]))
|
||||
return root.childNodes[0].childNodes[0].nodeValue === "test"
|
||||
})
|
||||
|
||||
//m.redraw
|
||||
test(function() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue