Merge branch 'next' of https://github.com/lhorie/mithril.js into strict-mode

This commit is contained in:
Isiah Meadows 2017-03-03 18:27:24 -05:00
commit d4a0417dde
7 changed files with 336 additions and 205 deletions

View file

@ -119,6 +119,21 @@ o.spec("onbeforeupdate", function() {
o(count).equals(1)
})
o("doesn't fire on recycled nodes", function() {
var onbeforeupdate = o.spy()
var vnodes = [{tag: "div", key: 1}]
var temp = []
var updated = [{tag: "div", key: 1, attrs: {onbeforeupdate: onbeforeupdate}}]
render(root, vnodes)
render(root, temp)
render(root, updated)
o(vnodes[0].dom).equals(updated[0].dom)
o(updated[0].dom.nodeName).equals("DIV")
o(onbeforeupdate.callCount).equals(0)
})
components.forEach(function(cmp){
o.spec(cmp.kind, function(){
var createComponent = cmp.create