Check for weird edge-case & tests

This commit is contained in:
Richard Eames 2014-09-18 12:04:02 -06:00
parent c3d3fa7315
commit f3018776b8
2 changed files with 13 additions and 1 deletions

View file

@ -154,6 +154,18 @@ function testMithril(mock) {
m.render(root, m("ul", [{}]))
return root.childNodes[0].childNodes.length === 0
})
test(function() {
var root = mock.document.createElement("div")
m.render(root, m("ul", [m("li")]))
m.render(root, m("ul", [{tag: "b", attrs: {}}]))
return root.childNodes[0].childNodes[0].nodeName == "B"
})
test(function() {
var root = mock.document.createElement("div")
m.render(root, m("ul", [m("li")]))
m.render(root, m("ul", [{tag: new String("b"), attrs: {}}]))
return root.childNodes[0].childNodes[0].nodeName == "B"
})
test(function() {
var root = mock.document.createElement("div")
m.render(root, m("ul", [m("li", [m("a")])]))