From b787f2f731e2935e224d2916632febc6c7a7eb4a Mon Sep 17 00:00:00 2001 From: Barney Carroll Date: Fri, 29 Jul 2016 13:47:13 +0100 Subject: [PATCH] Basic assertion for nested onbeforeremove execution --- render/tests/test-onbeforeremove.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/render/tests/test-onbeforeremove.js b/render/tests/test-onbeforeremove.js index a289b055c..b8659f4db 100644 --- a/render/tests/test-onbeforeremove.js +++ b/render/tests/test-onbeforeremove.js @@ -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) + }) })