From 193b08e10cbc2fb6d97f0adf7ce7126a23a1b4cb Mon Sep 17 00:00:00 2001 From: Barney Carroll Date: Thu, 14 Jul 2016 14:09:04 +0100 Subject: [PATCH] Test for #1146 --- api/tests/test-mount.js | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/api/tests/test-mount.js b/api/tests/test-mount.js index 83218175..db77ce30 100644 --- a/api/tests/test-mount.js +++ b/api/tests/test-mount.js @@ -98,7 +98,7 @@ o.spec("mount", function() { }, FRAME_BUDGET) }) - o("redraws when the render function is run", function(done) { + o("redraws when the render function is run", function(done) { var onupdate = o.spy() var oninit = o.spy() @@ -123,4 +123,28 @@ o.spec("mount", function() { done() }, FRAME_BUDGET) }) + + o("updates when new mounts are instantiated", function(done) { + var onupdate = o.spy() + + mount(root, { + view : function() { + return m("div", { + onupdate : onupdate, + oncreate : function( node ){ + mount(node.dom, { + view : function(){ + return m("div", { + oncreate : function(){ + o(onupdate.callCount).equals(1) + done() + } + } ) + } + }) + } + }) + } + }) + }) })