fix bugs about recycling in components, and styles when reusing style object

This commit is contained in:
Leo Horie 2016-06-02 21:42:18 -04:00
parent 86673f8d16
commit f9ef480b34
5 changed files with 157 additions and 11 deletions

View file

@ -537,6 +537,23 @@ o.spec("component", function() {
o(called).equals(1)
o(root.childNodes.length).equals(0)
})
o("does not recycle when there's an onupdate", function() {
var component = {
onupdate: function() {},
view: function() {
return {tag: "div"}
}
}
var update = o.spy()
var vnode = {tag: component, key: 1}
var updated = {tag: component, key: 1}
render(root, [vnode])
render(root, [])
render(root, [updated])
o(vnode.dom).notEquals(updated.dom)
})
})
o.spec("state", function() {
o("deep copies state", function() {