Skip to content

Commit

Permalink
Basic assertion for nested onbeforeremove execution
Browse files Browse the repository at this point in the history
  • Loading branch information
barneycarroll committed Jul 29, 2016
1 parent fd2f381 commit b787f2f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions render/tests/test-onbeforeremove.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,4 +167,16 @@ o.spec("onbeforeremove", function() {

o(vnode.dom).notEquals(updated.dom)
})
o("triggers onbeforeremove hooks in descendants of the removed node", function() {
var count = 0
var increment = function() {count++}
var vnode = {tag: "div", key: 1, attrs: {onbeforeremove: increment}, children: [
{tag: "div", key: 1, attrs: {onbeforeremove: increment}}
]}

render(root, [vnode])
render(root, [])

o(count).equals(2)
})
})

0 comments on commit b787f2f

Please sign in to comment.