handles noop from undefined to null #1473

This commit is contained in:
Leo Horie 2016-12-16 15:21:57 -05:00
parent b9a479d45e
commit c95629c623
2 changed files with 10 additions and 1 deletions

View file

@ -104,6 +104,15 @@ o.spec("updateNodes", function() {
o(updated[0].dom.nodeValue).equals("a")
o(updated[0].dom).equals(root.childNodes[0])
})
o("handles undefined to null noop", function() {
var vnodes = [null, {tag: "div"}]
var updated = [undefined, {tag: "div"}]
render(root, vnodes)
render(root, updated)
o(root.childNodes.length).equals(1)
})
o("reverses els w/ even count", function() {
var vnodes = [{tag: "a", key: 1}, {tag: "b", key: 2}, {tag: "i", key: 3}, {tag: "s", key: 4}]
var updated = [{tag: "s", key: 4}, {tag: "i", key: 3}, {tag: "b", key: 2}, {tag: "a", key: 1}]